Package Summary  Overview Summary

class:XMLInputFactory [NONE]


  • public abstract class XMLInputFactory
    extends Object
    
    Defines an abstract implementation of a factory for getting streams. The following table defines the standard properties of this specification. Each property varies in the level of support required by each implementation. The level of support required is described in the 'Required' column.
    Configuration Parameters
    Property Name BehaviorReturn type Default Value Required
    javax.xml.stream.isValidatingTurns on/off implementation specific DTD validation BooleanFalseNo
    javax.xml.stream.isNamespaceAwareTurns on/off namespace processing for XML 1.0 support BooleanTrueTrue (required) / False (optional)
    javax.xml.stream.isCoalescingRequires the processor to coalesce adjacent character data BooleanFalseYes
    javax.xml.stream.isReplacingEntityReferencesreplace internal entity references with their replacement text and report them as characters BooleanTrueYes
    javax.xml.stream.isSupportingExternalEntitiesResolve external parsed entities BooleanUnspecifiedYes
    javax.xml.stream.supportDTDUse this property to request processors that do not support DTDs BooleanTrueYes
    javax.xml.stream.reportersets/gets the impl of the XMLReporter javax.xml.stream.XMLReporterNullYes
    javax.xml.stream.resolversets/gets the impl of the XMLResolver interface javax.xml.stream.XMLResolverNullYes
    javax.xml.stream.allocatorsets/gets the impl of the XMLEventAllocator interface javax.xml.stream.util.XMLEventAllocatorNullYes
    Since:
    1.6
    See Also:
    XMLOutputFactory, XMLEventReader, XMLStreamReader, EventFilter, XMLReporter, XMLResolver, XMLEventAllocator

field:IS_NAMESPACE_AWARE [NONE]

  • IS_NAMESPACE_AWARE

    public static final String IS_NAMESPACE_AWARE
    The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported
    See Also:
    Constant Field Values

field:IS_VALIDATING [NONE]

  • IS_VALIDATING

    public static final String IS_VALIDATING
    The property used to turn on/off implementation specific validation
    See Also:
    Constant Field Values

field:IS_COALESCING [NONE]

  • IS_COALESCING

    public static final String IS_COALESCING
    The property that requires the parser to coalesce adjacent character data sections
    See Also:
    Constant Field Values

field:IS_REPLACING_ENTITY_REFERENCES [NONE]

  • IS_REPLACING_ENTITY_REFERENCES

    public static final String IS_REPLACING_ENTITY_REFERENCES
    Requires the parser to replace internal entity references with their replacement text and report them as characters
    See Also:
    Constant Field Values

field:IS_SUPPORTING_EXTERNAL_ENTITIES [NONE]

  • IS_SUPPORTING_EXTERNAL_ENTITIES

    public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
    The property that requires the parser to resolve external parsed entities
    See Also:
    Constant Field Values

field:SUPPORT_DTD [NONE]

field:REPORTER [NONE]

  • REPORTER

    public static final String REPORTER
    The property used to set/get the implementation of the XMLReporter interface
    See Also:
    Constant Field Values

field:RESOLVER [NONE]

  • RESOLVER

    public static final String RESOLVER
    The property used to set/get the implementation of the XMLResolver
    See Also:
    Constant Field Values

field:ALLOCATOR [NONE]

  • ALLOCATOR

    public static final String ALLOCATOR
    The property used to set/get the implementation of the allocator
    See Also:
    Constant Field Values

constructor:<init>() [NONE]

  • XMLInputFactory

    protected XMLInputFactory()

method:newDefaultFactory() [NONE]

  • newDefaultFactory

    public static XMLInputFactory newDefaultFactory()
    Creates a new instance of the XMLInputFactory builtin system-default implementation.
    Returns:
    A new instance of the XMLInputFactory builtin system-default implementation.
    Since:
    9

method:newInstance() [NONE]

method:newFactory() [NONE]

  • newFactory

    public static XMLInputFactory newFactory()
                                      throws FactoryConfigurationError
    
    Create a new instance of the factory.

    This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the XMLInputFactory implementation class to load:

    • Use the javax.xml.stream.XMLInputFactory system property.

    • Use the configuration file "stax.properties". The file is in standard Properties format and typically located in the conf directory of the Java installation. It contains the fully qualified name of the implementation class with the key being the system property defined above.

      The stax.properties file is read only once by the implementation and its values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property in stax.properties after it has been read for the first time.

      Use the jaxp configuration file "jaxp.properties". The file is in the same format as stax.properties and will only be read if stax.properties does not exist.

    • Use the service-provider loading facility, defined by the ServiceLoader class, to attempt to locate and load an implementation of the service using the default loading mechanism : the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.

    • Otherwise, the system-default implementation is returned.

    Once an application has obtained a reference to a XMLInputFactory it can use the factory to configure and obtain stream instances.

    Throws:
    FactoryConfigurationError - in case of service configuration error or if the implementation is not available or cannot be instantiated.

method:newInstance(java.lang.String,java.lang.ClassLoader) [NONE]

method:newFactory(java.lang.String,java.lang.ClassLoader) [NONE]

  • newFactory

    public static XMLInputFactory newFactory​(String factoryId,
                                             ClassLoader classLoader)
                                      throws FactoryConfigurationError
    
    Create a new instance of the factory. If the classLoader argument is null, then the ContextClassLoader is used.

    This method uses the following ordered lookup procedure to determine the XMLInputFactory implementation class to load:

    • Use the value of the system property identified by factoryId.

    • Use the configuration file "stax.properties". The file is in standard Properties format and typically located in the conf directory of the Java installation. It contains the fully qualified name of the implementation class with the key being the system property defined above.

      The stax.properties file is read only once by the implementation and its values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property in stax.properties after it has been read for the first time.

      Use the jaxp configuration file "jaxp.properties". The file is in the same format as stax.properties and will only be read if stax.properties does not exist.

    • If factoryId is "javax.xml.stream.XMLInputFactory", use the service-provider loading facility, defined by the ServiceLoader class, to attempt to locate and load an implementation of the service using the specified ClassLoader. If classLoader is null, the default loading mechanism will apply: That is, the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.

    • Otherwise, throws a FactoryConfigurationError.

    Note that this is a new method that replaces the deprecated newInstance(String factoryId, ClassLoader classLoader) method. No changes in behavior are defined by this replacement method relative to the deprecated method.

    API Note:
    The parameter factoryId defined here is inconsistent with that of other JAXP factories where the first parameter is fully qualified factory class name that provides implementation of the factory.
    Parameters:
    factoryId - Name of the factory to find, same as a property name
    classLoader - classLoader to use
    Returns:
    the factory implementation
    Throws:
    FactoryConfigurationError - in case of service configuration error or if the implementation is not available or cannot be instantiated.
    FactoryConfigurationError - if an instance of this factory cannot be loaded

method:createXMLStreamReader(java.io.Reader) [NONE]

method:createXMLStreamReader(javax.xml.transform.Source) [NONE]

method:createXMLStreamReader(java.io.InputStream) [NONE]

method:createXMLStreamReader(java.io.InputStream,java.lang.String) [NONE]

method:createXMLStreamReader(java.lang.String,java.io.InputStream) [NONE]

method:createXMLStreamReader(java.lang.String,java.io.Reader) [NONE]

method:createXMLEventReader(java.io.Reader) [NONE]

method:createXMLEventReader(java.lang.String,java.io.Reader) [NONE]

method:createXMLEventReader(javax.xml.stream.XMLStreamReader) [NONE]

  • createXMLEventReader

    public abstract XMLEventReader createXMLEventReader​(XMLStreamReader reader)
                                                 throws XMLStreamException
    
    Create a new XMLEventReader from an XMLStreamReader. After being used to construct the XMLEventReader instance returned from this method the XMLStreamReader must not be used.
    Parameters:
    reader - the XMLStreamReader to read from (may not be modified)
    Returns:
    a new XMLEventReader
    Throws:
    XMLStreamException

method:createXMLEventReader(javax.xml.transform.Source) [NONE]

method:createXMLEventReader(java.io.InputStream) [NONE]

method:createXMLEventReader(java.io.InputStream,java.lang.String) [NONE]

method:createXMLEventReader(java.lang.String,java.io.InputStream) [NONE]

method:createFilteredReader(javax.xml.stream.XMLStreamReader,javax.xml.stream.StreamFilter) [NONE]

method:createFilteredReader(javax.xml.stream.XMLEventReader,javax.xml.stream.EventFilter) [NONE]

method:getXMLResolver() [NONE]

  • getXMLResolver

    public abstract XMLResolver getXMLResolver()
    The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

method:setXMLResolver(javax.xml.stream.XMLResolver) [NONE]

  • setXMLResolver

    public abstract void setXMLResolver​(XMLResolver resolver)
    The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
    Parameters:
    resolver - the resolver to use to resolve references

method:getXMLReporter() [NONE]

  • getXMLReporter

    public abstract XMLReporter getXMLReporter()
    The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

method:setXMLReporter(javax.xml.stream.XMLReporter) [NONE]

  • setXMLReporter

    public abstract void setXMLReporter​(XMLReporter reporter)
    The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
    Parameters:
    reporter - the resolver to use to report non fatal errors

method:setProperty(java.lang.String,java.lang.Object) [NONE]

  • setProperty

    public abstract void setProperty​(String name,
                                     Object value)
                              throws IllegalArgumentException
    
    Allows the user to set specific feature/property on the underlying implementation. The underlying implementation is not required to support every setting of every property in the specification and may use IllegalArgumentException to signal that an unsupported property may not be set with the specified value.

    All implementations that implement JAXP 1.5 or newer are required to support the XMLConstants.ACCESS_EXTERNAL_DTD property.

    Parameters:
    name - The name of the property (may not be null)
    value - The value of the property
    Throws:
    IllegalArgumentException - if the property is not supported

method:getProperty(java.lang.String) [NONE]

  • getProperty

    public abstract Object getProperty​(String name)
                                throws IllegalArgumentException
    
    Get the value of a feature/property from the underlying implementation
    Parameters:
    name - The name of the property (may not be null)
    Returns:
    The value of the property
    Throws:
    IllegalArgumentException - if the property is not supported

method:isPropertySupported(java.lang.String) [NONE]

  • isPropertySupported

    public abstract boolean isPropertySupported​(String name)
    Query the set of properties that this factory supports.
    Parameters:
    name - The name of the property (may not be null)
    Returns:
    true if the property is supported and false otherwise

method:setEventAllocator(javax.xml.stream.util.XMLEventAllocator) [NONE]

  • setEventAllocator

    public abstract void setEventAllocator​(XMLEventAllocator allocator)
    Set a user defined event allocator for events
    Parameters:
    allocator - the user defined allocator

method:getEventAllocator() [NONE]

  • getEventAllocator

    public abstract XMLEventAllocator getEventAllocator()
    Gets the allocator used by streams created with this factory

© 2019 Oracle Corporation and/or its affiliates