Class XMLSchemaValidatorProp
- java.lang.Object
- com.iizix.prop.GProp<java.util.Map<java.lang.String,java.lang.String>>
- com.iizix.prop.StringMapProp
- com.iizix.prop.XMLSchemaValidatorProp
- All Implemented Interfaces:
EventListener
,IGProp<java.util.Map<java.lang.String,java.lang.String>>
,java.lang.Cloneable
,org.w3c.dom.ls.LSResourceResolver
public class XMLSchemaValidatorProp extends StringMapProp implements org.w3c.dom.ls.LSResourceResolver
XML Schema validator property class used to validate XML sources. This property is an extends the StringMapProp property class and stores the required schemas The XML Schemas are stored in the hash map with the namespaces URI as the key and the XSD source as values.- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
Constructors Modifier Constructor Description protected
XMLSchemaValidatorProp()
Creates an XML Schema validator property with no name and an empty set if schema sources.XMLSchemaValidatorProp(Atom propertyAtom)
Creates an XML Schema validator property with specified name and an empty set if schema sources.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLSchemaValidatorProp
clone()
Clones the XMLSchemaValidatorProp.static org.w3c.dom.ls.DOMImplementationLS
getDom3LoadSave()
Gets the DOM Level 3 load/save implementation.static java.lang.String
getResourceSchema(java.lang.String namespaceURI)
Gets the URL for a resource based namespace provided with iizi, i.e.static javax.xml.validation.SchemaFactory
getSchemaFactory()
Gets the schema factory.javax.xml.validation.Validator
getValidator()
Gets or creates the Schema validator from the Schema sources.protected boolean
isPropPrivateAtCreation()
Called upon creation of the property to check it's private state.void
resetValidator()
Resets the validator if new Schema sources have been added to the map using the StringMap functions.org.w3c.dom.ls.LSInput
resolveResource(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI)
Allow the application to resolve external resources.void
setXMLSchemas(java.util.Map<java.lang.String,java.lang.String> schemaSources, javax.xml.validation.Validator validator)
Assigns the map of the schema sources along with an existing validator.Methods inherited from class com.iizix.prop.StringMapProp
addSystemProperties, appendPropValue, clear, equalValues, getHashMap, getPropValue0, getStringMapAsStringArray, getValue, getValueClasses, initializeElement, initializeProp, initializeValue, modifyPropValue, put, removeKey, size, toNativeValue0, validatePropType
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalsTree, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferences, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropDispose, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onPropValueSet, onReferenceEvent, onRemoteEvent, onVirtualizationCompleted, onVirtualized, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toElementString, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verify, verifyHasPropertyItem, virtualize, warning, warning, warning
Constructor Detail
XMLSchemaValidatorProp
protected XMLSchemaValidatorProp()
Creates an XML Schema validator property with no name and an empty set if schema sources.
XMLSchemaValidatorProp
public XMLSchemaValidatorProp(Atom propertyAtom)
Creates an XML Schema validator property with specified name and an empty set if schema sources.- Parameters:
propertyAtom
- the property atom.
Method Detail
getResourceSchema
public static java.lang.String getResourceSchema(java.lang.String namespaceURI)
Gets the URL for a resource based namespace provided with iizi, i.e. SOAP 1.1 and 1.2, WSDL 1.1 and XML security schemas.- Parameters:
namespaceURI
- The namespace URI, if null then null is returned.- Returns:
- The Schema contents, or null if not found.
isPropPrivateAtCreation
protected boolean isPropPrivateAtCreation()
Called upon creation of the property to check it's private state. This is used by properties that are not distributed to the remote party.The XML Schema validation property is private and is not transported to a remote party.
- Overrides:
isPropPrivateAtCreation
in classGProp<java.util.Map<java.lang.String,java.lang.String>>
- Returns:
- true if the property should be set to private at creation, false for default.
clone
public XMLSchemaValidatorProp clone()
Clones the XMLSchemaValidatorProp.- Overrides:
clone
in classStringMapProp
getSchemaFactory
public static javax.xml.validation.SchemaFactory getSchemaFactory() throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
Gets the schema factory. The factory is initialized for secure processing. In case of an exception, the error is logged as a severe event.- Returns:
- The instance of the factory.
- Throws:
org.xml.sax.SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException
getDom3LoadSave
public static org.w3c.dom.ls.DOMImplementationLS getDom3LoadSave() throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassCastException
Gets the DOM Level 3 load/save implementation. In case of an exception, the error is logged as a severe event.- Returns:
- The implementation instance.
- Throws:
java.lang.ClassNotFoundException
- If any specified class can not be found.java.lang.InstantiationException
- If any specified class is an interface or abstract class.java.lang.IllegalAccessException
- If the default constructor of a specified class is not accessible.java.lang.ClassCastException
- If any specified class does not implementDOMImplementationSource
.
setXMLSchemas
public void setXMLSchemas(java.util.Map<java.lang.String,java.lang.String> schemaSources, javax.xml.validation.Validator validator) throws PropTypeException
Assigns the map of the schema sources along with an existing validator.- Parameters:
schemaSources
- The map of namespaces as keys and their Schema sources as values.validator
- The Schema validator for the schemas.- Throws:
java.lang.NullPointerException
- If the validator or the schemas sources are null.PropTypeException
- If the property is read-only.
getValidator
public javax.xml.validation.Validator getValidator() throws org.xml.sax.SAXException
Gets or creates the Schema validator from the Schema sources.- Returns:
- The Schema validator.
- Throws:
org.xml.sax.SAXException
- If the validator could not be created.
resetValidator
public void resetValidator()
Resets the validator if new Schema sources have been added to the map using the StringMap functions. This will cause theValidator
created in the callgetValidator()
to be created again from the new sources.
resolveResource
public org.w3c.dom.ls.LSInput resolveResource(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI)
Allow the application to resolve external resources.The
LSParser
will call this method before opening any external resource, including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element (however, the top-level document entity is not passed to this method). The application may then request that theLSParser
resolve the external resource itself, that it use an alternative URI, or that it use an entirely different input source.Application writers can use this method to redirect external system identifiers to secure and/or local URI, to look up public identifiers in a catalog, or to read an entity from a database or other input source (including, for example, a dialog box).
- Specified by:
resolveResource
in interfaceorg.w3c.dom.ls.LSResourceResolver
- Parameters:
type
- The type of the resource being resolved. For XML resources (i.e. entities), applications must use the value"http://www.w3.org/TR/REC-xml"
. For XML Schema, applications must use the value"http://www.w3.org/2001/XMLSchema"
. Other types of resources are outside the scope of this specification and therefore should recommend an absolute URI in order to use this method.namespaceURI
- The namespace of the resource being resolved.publicId
- The public identifier of the external entity being referenced, ornull
for none.systemId
- The system identifier, a URI reference of the external resource being referenced, ornull
for none.baseURI
- The absolute base URI of the resource being parsed, ornull
if there is no base URI.- Returns:
- A
LSInput
object describing the new input source, ornull
to request that the parser open a regular URI connection to the resource.