Class XMLSchemaValidatorProp

  • All Implemented Interfaces:
    EventListener, IGProp<java.util.Map<java.lang.String,​java.lang.String>>, java.lang.Cloneable,

    public class XMLSchemaValidatorProp
    extends StringMapProp
    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.
    Christopher Mindus
    • 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.
        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.
        namespaceURI - The namespace URI, if null then null is returned.
        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.

        isPropPrivateAtCreation in class GProp<java.util.Map<java.lang.String,​java.lang.String>>
        true if the property should be set to private at creation, false for default.
      • getSchemaFactory

        public static javax.xml.validation.SchemaFactory getSchemaFactory()
                                                                   throws org.xml.sax.SAXNotRecognizedException,
        Gets the schema factory. The factory is initialized for secure processing. In case of an exception, the error is logged as a severe event.
        The instance of the factory.
      • getDom3LoadSave

        public static getDom3LoadSave()
                                                                  throws java.lang.ClassNotFoundException,
        Gets the DOM Level 3 load/save implementation. In case of an exception, the error is logged as a severe event.
        The implementation instance.
        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 implement DOMImplementationSource.
      • 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.
        schemaSources - The map of namespaces as keys and their Schema sources as values.
        validator - The Schema validator for the schemas.
        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.
        The Schema validator.
        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 the Validator created in the call getValidator() to be created again from the new sources.
      • resolveResource

        public 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 the LSParser 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 interface
        type - The type of the resource being resolved. For XML resources (i.e. entities), applications must use the value "". For XML Schema, applications must use the value "". 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, or null for none.
        systemId - The system identifier, a URI reference of the external resource being referenced, or null for none.
        baseURI - The absolute base URI of the resource being parsed, or null if there is no base URI.
        A LSInput object describing the new input source, or null to request that the parser open a regular URI connection to the resource.