Class XMLValidationSchemaFactory


  • public abstract class XMLValidationSchemaFactory
    extends java.lang.Object
    Defines an abstract factory for constructing XMLValidationSchema instances. This abstract base class has methods for instantiating the actual implementation (similar to the way XMLInputFactory works, and defines the API to use for configuring these instances, as well as factory methods concrete classes implement for actually creating XMLValidationSchema instances.

    Note: this class is part of the second major revision of StAX 2 API (StAX2, v2), and is optional for StAX2 implementations to support.

    See Also:
    XMLInputFactory, XMLValidationSchema, XMLInputFactory2
    • Field Detail

      • INTERNAL_ID_SCHEMA_DTD

        public static final java.lang.String INTERNAL_ID_SCHEMA_DTD
        See Also:
        Constant Field Values
      • INTERNAL_ID_SCHEMA_RELAXNG

        public static final java.lang.String INTERNAL_ID_SCHEMA_RELAXNG
        See Also:
        Constant Field Values
      • INTERNAL_ID_SCHEMA_W3C

        public static final java.lang.String INTERNAL_ID_SCHEMA_W3C
        See Also:
        Constant Field Values
      • INTERNAL_ID_SCHEMA_TREX

        public static final java.lang.String INTERNAL_ID_SCHEMA_TREX
        See Also:
        Constant Field Values
      • SYSTEM_PROPERTY_FOR_IMPL

        public static final java.lang.String SYSTEM_PROPERTY_FOR_IMPL
        Defines the system property that can be set to explicitly specify which implementation to use (in case there are multiple StAX2 implementations; or the one used does not specify other mechanisms for the loader to find the implementation class).
        See Also:
        Constant Field Values
      • SERVICE_DEFINITION_PATH

        public static final java.lang.String SERVICE_DEFINITION_PATH
        Path to resource that should contain implementation class definition.
        See Also:
        Constant Field Values
      • P_IS_NAMESPACE_AWARE

        public static final java.lang.String P_IS_NAMESPACE_AWARE
        Property that determines whether schemas constructed are namespace-aware, in cases where schema supports both namespace-aware and non-namespace aware modes. In general this only applies to DTDs, since namespace support for DTDs is both optional, and not well specified.

        Default value is TRUE. For schema types for which only one value (usually TRUE) is allowed, this property will be ignored.

        See Also:
        Constant Field Values
      • P_ENABLE_CACHING

        public static final java.lang.String P_ENABLE_CACHING
        Property that determines whether schema instances created by this factory instance can be cached by the factory; if false, no caching is allowed to be doe; if true, factory can do caching if it wants to. The exact rules used to determine unique id of schema instances is factory dependant; it is expected that the implementations use implementation based on unified system ids (serialized URLs or such).
        See Also:
        Constant Field Values
      • mSchemaType

        protected final java.lang.String mSchemaType
        Schema type this factory instance supports.
    • Constructor Detail

      • XMLValidationSchemaFactory

        protected XMLValidationSchemaFactory​(java.lang.String st)
        Parameters:
        st - Schema type this factory supports; one of SCHEMA_ID_xxx constants.
    • Method Detail

      • newInstance

        public static XMLValidationSchemaFactory newInstance​(java.lang.String schemaType)
                                                      throws javax.xml.stream.FactoryConfigurationError
        Creates a new XMLValidationFactory instance, using the default instance configuration mechanism.
        Throws:
        javax.xml.stream.FactoryConfigurationError
      • newInstance

        public static XMLValidationSchemaFactory newInstance​(java.lang.String schemaType,
                                                             java.lang.ClassLoader classLoader)
                                                      throws javax.xml.stream.FactoryConfigurationError
        Throws:
        javax.xml.stream.FactoryConfigurationError
      • createSchema

        public XMLValidationSchema createSchema​(java.io.InputStream in)
                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public XMLValidationSchema createSchema​(java.io.InputStream in,
                                                java.lang.String encoding)
                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public abstract XMLValidationSchema createSchema​(java.io.InputStream in,
                                                         java.lang.String encoding,
                                                         java.lang.String publicId,
                                                         java.lang.String systemId)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public XMLValidationSchema createSchema​(java.io.Reader r)
                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public abstract XMLValidationSchema createSchema​(java.io.Reader r,
                                                         java.lang.String publicId,
                                                         java.lang.String systemId)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public abstract XMLValidationSchema createSchema​(java.net.URL url)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createSchema

        public abstract XMLValidationSchema createSchema​(java.io.File f)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • isPropertySupported

        public abstract boolean isPropertySupported​(java.lang.String propName)
      • setProperty

        public abstract boolean setProperty​(java.lang.String propName,
                                            java.lang.Object value)
        Parameters:
        propName - Name of property to set
        value - Value to set property to
        Returns:
        True if setting succeeded; false if property was recognized but could not be changed to specified value, or if it was not recognized but the implementation did not throw an exception.
      • getProperty

        public abstract java.lang.Object getProperty​(java.lang.String propName)
      • getSchemaType

        public final java.lang.String getSchemaType()
        Returns:
        Name of schema type (one of SCHEMA_ID_xxx constants) that this factory supports.