javax.xml.stream

Class XMLInputFactory

Known Direct Subclasses:
XMLInputFactoryImpl

public abstract class XMLInputFactory
extends Object

Factory for creating stream and event readers from various kinds of input source.

Parameters

NameDescriptionTypeDefaultRequired
javax.xml.stream.isValidatingControls DTD validationBooleanBoolean.FALSEno
javax.xml.stream.isNamespaceAwareControls namespace processing for XML 1.0BooleanBoolean.TRUEtrue is required, false is optional
javax.xml.stream.isCoalescingControls coalescing (normalization of adjacent character data)BooleanBoolean.FALSEyes
javax.xml.stream.isReplacingEntityReferencesControls replacement of entity references with their replacement textBooleanBoolean.TRUEyes
javax.xml.stream.isSupportingExternalEntitiesControls whether to resolve external entitiesBooleannot specifiedyes
javax.xml.stream.supportDTDControls whether to support DTDsBooleanBoolean.TRUEyes
javax.xml.stream.reporterjavax.xml.stream.XMLReporteryes
javax.xml.stream.resolverjavax.xml.stream.XMLResolveryes
javax.xml.stream.allocatorjavax.xml.stream.util.XMLEventAllocatoryes

Field Summary

static String
ALLOCATOR
Property used to control the event allocator implementation.
static String
IS_COALESCING
Property used to control whether to coalesce adjacent text events.
static String
IS_NAMESPACE_AWARE
Property used to control namespace support.
static String
IS_REPLACING_ENTITY_REFERENCES
Property used to control whether to replace entity references with their replacement text.
static String
IS_SUPPORTING_EXTERNAL_ENTITIES
Property used to control whether to resolve external entities.
static String
IS_VALIDATING
Property used to control DTD validation.
static String
REPORTER
Property used to control the error reporter implementation.
static String
RESOLVER
Property used to control the entity resolver implementation.
static String
SUPPORT_DTD
Property used to indicate whether to support DTDs.

Constructor Summary

XMLInputFactory()
The basic constructor.

Method Summary

abstract XMLEventReader
createFilteredReader(XMLEventReader reader, EventFilter filter)
Create a new filtered reader.
abstract XMLStreamReader
createFilteredReader(XMLStreamReader reader, StreamFilter filter)
Create a new filtered reader.
abstract XMLEventReader
createXMLEventReader(InputStream stream)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(InputStream stream, String encoding)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(Reader reader)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(String systemId, InputStream stream)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(String systemId, Reader reader)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(XMLStreamReader reader)
Creates a new event reader.
abstract XMLEventReader
createXMLEventReader(Source source)
Creates a new event reader.
abstract XMLStreamReader
createXMLStreamReader(InputStream stream)
Creates a new stream reader.
abstract XMLStreamReader
createXMLStreamReader(InputStream stream, String encoding)
Creates a new stream reader.
abstract XMLStreamReader
createXMLStreamReader(Reader reader)
Creates a new stream reader.
abstract XMLStreamReader
createXMLStreamReader(String systemId, InputStream stream)
Creates a new stream reader.
abstract XMLStreamReader
createXMLStreamReader(String systemId, Reader reader)
Creates a new stream reader.
abstract XMLStreamReader
createXMLStreamReader(Source source)
Creates a new stream reader.
abstract XMLEventAllocator
getEventAllocator()
Returns the event allocator.
abstract Object
getProperty(String name)
Returns the implementation-specific property of the given name.
abstract XMLReporter
getXMLReporter()
Returns the error reporter.
abstract XMLResolver
getXMLResolver()
Returns the entity resolver.
abstract boolean
isPropertySupported(String name)
Indicates whether the specified property is supported.
static XMLInputFactory
newInstance()
Creates a new factory instance.
static XMLInputFactory
newInstance(String factoryId, ClassLoader classLoader)
Creates a new factory instance.
abstract void
setEventAllocator(XMLEventAllocator allocator)
Sets the event allocator.
abstract void
setProperty(String name, Object value)
Sets the implementation-specific property of the given name.
abstract void
setXMLReporter(XMLReporter reporter)
Sets the error reporter.
abstract void
setXMLResolver(XMLResolver resolver)
Sets the entity resolver.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ALLOCATOR

public static final String ALLOCATOR
Property used to control the event allocator implementation.
Field Value:
"javax.xml.stream.allocator"

IS_COALESCING

public static final String IS_COALESCING
Property used to control whether to coalesce adjacent text events.
Field Value:
"javax.xml.stream.isCoalescing"

IS_NAMESPACE_AWARE

public static final String IS_NAMESPACE_AWARE
Property used to control namespace support.
Field Value:
"javax.xml.stream.isNamespaceAware"

IS_REPLACING_ENTITY_REFERENCES

public static final String IS_REPLACING_ENTITY_REFERENCES
Property used to control whether to replace entity references with their replacement text.
Field Value:
"javax.xml.stream.isReplacingEntityReferences"

IS_SUPPORTING_EXTERNAL_ENTITIES

public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
Property used to control whether to resolve external entities.
Field Value:
"javax.xml.stream.isSupportingExternalEntities"

IS_VALIDATING

public static final String IS_VALIDATING
Property used to control DTD validation.
Field Value:
"javax.xml.stream.isValidating"

REPORTER

public static final String REPORTER
Property used to control the error reporter implementation.
Field Value:
"javax.xml.stream.reporter"

RESOLVER

public static final String RESOLVER
Property used to control the entity resolver implementation.
Field Value:
"javax.xml.stream.resolver"

SUPPORT_DTD

public static final String SUPPORT_DTD
Property used to indicate whether to support DTDs.
Field Value:
"javax.xml.stream.supportDTD"

Constructor Details

XMLInputFactory

protected XMLInputFactory()
The basic constructor. Object is special, because it has no superclass, so there is no call to super().

Method Details

createFilteredReader

public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
                                                    EventFilter filter)
            throws XMLStreamException
Create a new filtered reader.

createFilteredReader

public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader,
                                                     StreamFilter filter)
            throws XMLStreamException
Create a new filtered reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream,
                                                    String encoding)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Reader reader)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId,
                                                    InputStream stream)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId,
                                                    Reader reader)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
            throws XMLStreamException
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Source source)
            throws XMLStreamException
Creates a new event reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream)
            throws XMLStreamException
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream,
                                                      String encoding)
            throws XMLStreamException
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Reader reader)
            throws XMLStreamException
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId,
                                                      InputStream stream)
            throws XMLStreamException
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId,
                                                      Reader reader)
            throws XMLStreamException
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Source source)
            throws XMLStreamException
Creates a new stream reader.

getEventAllocator

public abstract XMLEventAllocator getEventAllocator()
Returns the event allocator.

getProperty

public abstract Object getProperty(String name)
            throws IllegalArgumentException
Returns the implementation-specific property of the given name.
Throws:
IllegalArgumentException - if the property is not supported

getXMLReporter

public abstract XMLReporter getXMLReporter()
Returns the error reporter.

getXMLResolver

public abstract XMLResolver getXMLResolver()
Returns the entity resolver.

isPropertySupported

public abstract boolean isPropertySupported(String name)
Indicates whether the specified property is supported.

newInstance

public static XMLInputFactory newInstance()
            throws FactoryConfigurationError
Creates a new factory instance.

newInstance

public static XMLInputFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
            throws FactoryConfigurationError
Creates a new factory instance. The implementation class to load is the first found in the following locations:
  1. the javax.xml.stream.XMLInputFactory system property
  2. the above named property value in the $JAVA_HOME/lib/stax.properties file
  3. the class name specified in the META-INF/services/javax.xml.stream.XMLInputFactory system resource
  4. the default factory class
Parameters:
factoryId - name of the factory, same as a property name
classLoader - the class loader to use
Returns:
the factory implementation
Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

setEventAllocator

public abstract void setEventAllocator(XMLEventAllocator allocator)
Sets the event allocator.

setProperty

public abstract void setProperty(String name,
                                 Object value)
            throws IllegalArgumentException
Sets the implementation-specific property of the given name.
Throws:
IllegalArgumentException - if the property is not supported

setXMLReporter

public abstract void setXMLReporter(XMLReporter reporter)
Sets the error reporter.

setXMLResolver

public abstract void setXMLResolver(XMLResolver resolver)
Sets the entity resolver.

XMLInputFactory.java -- Copyright (C) 2005,2006,2009 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.