Class StAXInputFactory
java.lang.Object
javax.xml.stream.XMLInputFactory
com.sun.xml.fastinfoset.stax.factory.StAXInputFactory
-
Field Summary
Fields inherited from class javax.xml.stream.XMLInputFactory
ALLOCATOR, IS_COALESCING, IS_NAMESPACE_AWARE, IS_REPLACING_ENTITY_REFERENCES, IS_SUPPORTING_EXTERNAL_ENTITIES, IS_VALIDATING, REPORTER, RESOLVER, SUPPORT_DTD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFilteredReader(XMLEventReader reader, EventFilter filter) Create a filtered event reader that wraps the filter around the event readercreateFilteredReader(XMLStreamReader reader, StreamFilter filter) Create a filtered reader that wraps the filter around the readercreateXMLEventReader(InputStream inputstream) createXMLEventReader(InputStream stream, String encoding) createXMLEventReader(Reader reader) createXMLEventReader(String systemId, InputStream inputstream) createXMLEventReader(String systemId, Reader reader) createXMLEventReader(XMLStreamReader streamReader) Create a new XMLEventReader from an XMLStreamReader.createXMLEventReader(Source source) createXMLStreamReader(InputStream inputstream, String encoding) createXMLStreamReader(Reader xmlfile) Create a new XMLStreamReader from a readercreateXMLStreamReader(String systemId, InputStream inputstream) createXMLStreamReader(String systemId, Reader xmlfile) createXMLStreamReader(Source source) getProperty(String name) Get the value of a feature/property from the underlying implementationbooleanisPropertySupported(String name) Query the set of Properties that this factory supports.static XMLInputFactoryvoidsetEventAllocator(XMLEventAllocator allocator) Set a user defined event allocator for eventsvoidsetProperty(String name, Object value) Allows the user to set specific feature/property on the underlying implementation.voidsetXMLReporter(XMLReporter xmlreporter) voidsetXMLResolver(XMLResolver xmlresolver) Methods inherited from class javax.xml.stream.XMLInputFactory
newDefaultFactory, newFactory, newFactory, newInstance
-
Constructor Details
-
StAXInputFactory
public StAXInputFactory()
-
-
Method Details
-
newInstance
-
createXMLStreamReader
Create a new XMLStreamReader from a reader- Specified by:
createXMLStreamReaderin classXMLInputFactory- Parameters:
xmlfile- the XML data to read from- Throws:
XMLStreamException
-
createXMLStreamReader
- Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(String systemId, Reader xmlfile) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
- Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(String systemId, InputStream inputstream) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(InputStream inputstream, String encoding) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
- Specified by:
createXMLEventReaderin classXMLInputFactory- Parameters:
inputstream-- Returns:
- XMLEventReader
- Throws:
XMLStreamException
-
createXMLEventReader
- Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
- Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(String systemId, InputStream inputstream) throws XMLStreamException - Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(InputStream stream, String encoding) throws XMLStreamException - Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException - Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLEventReader
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.- Specified by:
createXMLEventReaderin classXMLInputFactory- Parameters:
streamReader- the XMLStreamReader to read from (may not be modified)- Returns:
- a new XMLEventReader
- Throws:
XMLStreamException
-
getEventAllocator
- Specified by:
getEventAllocatorin classXMLInputFactory
-
getXMLReporter
- Specified by:
getXMLReporterin classXMLInputFactory
-
getXMLResolver
- Specified by:
getXMLResolverin classXMLInputFactory
-
setXMLReporter
- Specified by:
setXMLReporterin classXMLInputFactory
-
setXMLResolver
- Specified by:
setXMLResolverin classXMLInputFactory
-
createFilteredReader
public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException Create a filtered event reader that wraps the filter around the event reader- Specified by:
createFilteredReaderin classXMLInputFactory- Parameters:
reader- the event reader to wrapfilter- the filter to apply to the event reader- Throws:
XMLStreamException
-
createFilteredReader
public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException Create a filtered reader that wraps the filter around the reader- Specified by:
createFilteredReaderin classXMLInputFactory- Parameters:
reader- the reader to filterfilter- the filter to apply to the reader- Throws:
XMLStreamException
-
getProperty
Get the value of a feature/property from the underlying implementation- Specified by:
getPropertyin classXMLInputFactory- 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
-
isPropertySupported
Query the set of Properties that this factory supports.- Specified by:
isPropertySupportedin classXMLInputFactory- Parameters:
name- The name of the property (may not be null)- Returns:
- true if the property is supported and false otherwise
-
setEventAllocator
Set a user defined event allocator for events- Specified by:
setEventAllocatorin classXMLInputFactory- Parameters:
allocator- the user defined allocator
-
setProperty
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.- Specified by:
setPropertyin classXMLInputFactory- 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
-