Class StAXInputFactory
- java.lang.Object
-
- javax.xml.stream.XMLInputFactory
-
- com.sun.xml.fastinfoset.stax.factory.StAXInputFactory
-
public class StAXInputFactory extends XMLInputFactory
-
-
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 Constructor Description StAXInputFactory()
-
Method Summary
-
Methods inherited from class javax.xml.stream.XMLInputFactory
newDefaultFactory, newFactory, newFactory, newInstance
-
-
-
-
Method Detail
-
newInstance
public static XMLInputFactory newInstance()
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(Reader xmlfile) throws XMLStreamException
Create a new XMLStreamReader from a reader- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Parameters:
xmlfile
- the XML data to read from- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(InputStream s) throws XMLStreamException
- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(String systemId, Reader xmlfile) throws XMLStreamException
- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException
- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(String systemId, InputStream inputstream) throws XMLStreamException
- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLStreamReader
public XMLStreamReader createXMLStreamReader(InputStream inputstream, String encoding) throws XMLStreamException
- Specified by:
createXMLStreamReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(InputStream inputstream) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Parameters:
inputstream
-- Returns:
- XMLEventReader
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(String systemId, InputStream inputstream) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(InputStream stream, String encoding) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException
- Specified by:
createXMLEventReader
in classXMLInputFactory
- Throws:
XMLStreamException
-
createXMLEventReader
public XMLEventReader createXMLEventReader(XMLStreamReader streamReader) 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.- Specified by:
createXMLEventReader
in classXMLInputFactory
- Parameters:
streamReader
- the XMLStreamReader to read from (may not be modified)- Returns:
- a new XMLEventReader
- Throws:
XMLStreamException
-
getEventAllocator
public XMLEventAllocator getEventAllocator()
- Specified by:
getEventAllocator
in classXMLInputFactory
-
getXMLReporter
public XMLReporter getXMLReporter()
- Specified by:
getXMLReporter
in classXMLInputFactory
-
getXMLResolver
public XMLResolver getXMLResolver()
- Specified by:
getXMLResolver
in classXMLInputFactory
-
setXMLReporter
public void setXMLReporter(XMLReporter xmlreporter)
- Specified by:
setXMLReporter
in classXMLInputFactory
-
setXMLResolver
public void setXMLResolver(XMLResolver xmlresolver)
- Specified by:
setXMLResolver
in 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:
createFilteredReader
in 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:
createFilteredReader
in classXMLInputFactory
- Parameters:
reader
- the reader to filterfilter
- the filter to apply to the reader- Throws:
XMLStreamException
-
getProperty
public Object getProperty(String name) throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation- Specified by:
getProperty
in 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
public boolean isPropertySupported(String name)
Query the set of Properties that this factory supports.- Specified by:
isPropertySupported
in classXMLInputFactory
- Parameters:
name
- The name of the property (may not be null)- Returns:
- true if the property is supported and false otherwise
-
setEventAllocator
public void setEventAllocator(XMLEventAllocator allocator)
Set a user defined event allocator for events- Specified by:
setEventAllocator
in classXMLInputFactory
- Parameters:
allocator
- the user defined allocator
-
setProperty
public 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.- Specified by:
setProperty
in 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
-
-