Class InputFactoryImpl
- java.lang.Object
-
- javax.xml.stream.XMLInputFactory
-
- org.codehaus.stax2.XMLInputFactory2
-
- com.fasterxml.aalto.AsyncXMLInputFactory
-
- com.fasterxml.aalto.stax.InputFactoryImpl
-
- All Implemented Interfaces:
org.codehaus.stax2.XMLStreamProperties
public final class InputFactoryImpl extends AsyncXMLInputFactory
Aalto implementation of basic Stax factory (bothXMLInputFactoryandXMLInputFactory2) as well as API for producing non-blocking (async) parsers (that is,AsyncXMLInputFactory).
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.xml.stream.util.XMLEventAllocator_allocator(package private) ReaderConfig_configThis is the currently active configuration that will be used for readers created by this factory.-
Fields inherited from class org.codehaus.stax2.XMLInputFactory2
P_AUTO_CLOSE_INPUT, P_DTD_OVERRIDE, P_INTERN_NAMES, P_INTERN_NS_URIS, P_LAZY_PARSING, P_PRESERVE_LOCATION, P_REPORT_CDATA, P_REPORT_PROLOG_WHITESPACE
-
-
Constructor Summary
Constructors Constructor Description InputFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureForConvenience()voidconfigureForLowMemUsage()voidconfigureForRoundTripping()voidconfigureForSpeed()voidconfigureForXmlConformance()org.codehaus.stax2.XMLEventReader2constructER(org.codehaus.stax2.XMLStreamReader2 sr)protected org.codehaus.stax2.XMLStreamReader2constructSR(java.io.File f, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR(java.io.InputStream in, java.lang.String enc, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR(java.lang.String systemId, java.io.InputStream in, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR(java.lang.String systemId, java.io.Reader r, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR(java.net.URL src, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR(javax.xml.transform.Source src, boolean forEventReader)protected org.codehaus.stax2.XMLStreamReader2constructSR2(org.codehaus.stax2.io.Stax2Source ss, boolean forEventReader)AsyncXMLStreamReader<AsyncByteArrayFeeder>createAsyncFor(byte[] input)Method for constructing a non-blockingXMLStreamReader2instance with specified initial input data.AsyncXMLStreamReader<AsyncByteArrayFeeder>createAsyncFor(byte[] input, int offset, int length)Method for constructing a non-blockingXMLStreamReader2instance with specified initial input data.AsyncXMLStreamReader<AsyncByteBufferFeeder>createAsyncFor(java.nio.ByteBuffer input)Method for constructing a non-blockingXMLStreamReader2instance with specified initial input data.AsyncXMLStreamReader<AsyncByteArrayFeeder>createAsyncForByteArray()Method for constructing a non-blockingXMLStreamReader2instance without any input data.AsyncXMLStreamReader<AsyncByteBufferFeeder>createAsyncForByteBuffer()Method for constructing a non-blockingXMLStreamReader2instance without any input data.protected javax.xml.stream.util.XMLEventAllocatorcreateEventAllocator()javax.xml.stream.XMLEventReadercreateFilteredReader(javax.xml.stream.XMLEventReader reader, javax.xml.stream.EventFilter filter)javax.xml.stream.XMLStreamReadercreateFilteredReader(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.StreamFilter filter)org.codehaus.stax2.XMLEventReader2createXMLEventReader(java.io.File f)javax.xml.stream.XMLEventReadercreateXMLEventReader(java.io.InputStream in)javax.xml.stream.XMLEventReadercreateXMLEventReader(java.io.InputStream in, java.lang.String enc)javax.xml.stream.XMLEventReadercreateXMLEventReader(java.io.Reader r)javax.xml.stream.XMLEventReadercreateXMLEventReader(java.lang.String systemId, java.io.InputStream in)javax.xml.stream.XMLEventReadercreateXMLEventReader(java.lang.String systemId, java.io.Reader r)org.codehaus.stax2.XMLEventReader2createXMLEventReader(java.net.URL src)javax.xml.stream.XMLEventReadercreateXMLEventReader(javax.xml.stream.XMLStreamReader sr)javax.xml.stream.XMLEventReadercreateXMLEventReader(javax.xml.transform.Source source)org.codehaus.stax2.XMLStreamReader2createXMLStreamReader(java.io.File f)Convenience factory method that allows for parsing a document stored in the specified file.javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.io.InputStream in)javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.io.InputStream in, java.lang.String enc)javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.io.Reader r)javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.lang.String systemId, java.io.InputStream in)javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.lang.String systemId, java.io.Reader r)org.codehaus.stax2.XMLStreamReader2createXMLStreamReader(java.net.URL src)javax.xml.stream.XMLStreamReadercreateXMLStreamReader(javax.xml.transform.Source src)javax.xml.stream.util.XMLEventAllocatorgetEventAllocator()ReaderConfiggetNonSharedConfig(java.lang.String systemId, java.lang.String publicId, java.lang.String extEncoding, boolean forEventReader, boolean forceAutoClose)Method called when a non-shared copy of the current configuration is needed.java.lang.ObjectgetProperty(java.lang.String name)javax.xml.stream.XMLReportergetXMLReporter()javax.xml.stream.XMLResolvergetXMLResolver()booleanisPropertySupported(java.lang.String name)voidsetEventAllocator(javax.xml.stream.util.XMLEventAllocator allocator)voidsetProperty(java.lang.String propName, java.lang.Object value)voidsetXMLReporter(javax.xml.stream.XMLReporter r)voidsetXMLResolver(javax.xml.stream.XMLResolver r)
-
-
-
Field Detail
-
_config
final ReaderConfig _config
This is the currently active configuration that will be used for readers created by this factory.
-
_allocator
protected javax.xml.stream.util.XMLEventAllocator _allocator
-
-
Method Detail
-
createFilteredReader
public javax.xml.stream.XMLEventReader createFilteredReader(javax.xml.stream.XMLEventReader reader, javax.xml.stream.EventFilter filter)- Specified by:
createFilteredReaderin classjavax.xml.stream.XMLInputFactory
-
createFilteredReader
public javax.xml.stream.XMLStreamReader createFilteredReader(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.StreamFilter filter) throws javax.xml.stream.XMLStreamException- Specified by:
createFilteredReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(java.io.InputStream in) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(java.io.InputStream in, java.lang.String enc) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(java.io.Reader r) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(javax.xml.transform.Source source) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(java.lang.String systemId, java.io.InputStream in) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(java.lang.String systemId, java.io.Reader r) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public javax.xml.stream.XMLEventReader createXMLEventReader(javax.xml.stream.XMLStreamReader sr) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in, java.lang.String enc) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.Reader r) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.lang.String systemId, java.io.Reader r) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(javax.xml.transform.Source src) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.lang.String systemId, java.io.InputStream in) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classjavax.xml.stream.XMLInputFactory- Throws:
javax.xml.stream.XMLStreamException
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
- Specified by:
getPropertyin classjavax.xml.stream.XMLInputFactory
-
setProperty
public void setProperty(java.lang.String propName, java.lang.Object value)- Specified by:
setPropertyin classjavax.xml.stream.XMLInputFactory
-
getEventAllocator
public javax.xml.stream.util.XMLEventAllocator getEventAllocator()
- Specified by:
getEventAllocatorin classjavax.xml.stream.XMLInputFactory
-
getXMLReporter
public javax.xml.stream.XMLReporter getXMLReporter()
- Specified by:
getXMLReporterin classjavax.xml.stream.XMLInputFactory
-
getXMLResolver
public javax.xml.stream.XMLResolver getXMLResolver()
- Specified by:
getXMLResolverin classjavax.xml.stream.XMLInputFactory
-
isPropertySupported
public boolean isPropertySupported(java.lang.String name)
- Specified by:
isPropertySupportedin classjavax.xml.stream.XMLInputFactory
-
setEventAllocator
public void setEventAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
- Specified by:
setEventAllocatorin classjavax.xml.stream.XMLInputFactory
-
setXMLReporter
public void setXMLReporter(javax.xml.stream.XMLReporter r)
- Specified by:
setXMLReporterin classjavax.xml.stream.XMLInputFactory
-
setXMLResolver
public void setXMLResolver(javax.xml.stream.XMLResolver r)
- Specified by:
setXMLResolverin classjavax.xml.stream.XMLInputFactory
-
createXMLEventReader
public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(java.net.URL src) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classorg.codehaus.stax2.XMLInputFactory2- Throws:
javax.xml.stream.XMLStreamException
-
createXMLEventReader
public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(java.io.File f) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLEventReaderin classorg.codehaus.stax2.XMLInputFactory2- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(java.net.URL src) throws javax.xml.stream.XMLStreamException- Specified by:
createXMLStreamReaderin classorg.codehaus.stax2.XMLInputFactory2- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(java.io.File f) throws javax.xml.stream.XMLStreamExceptionConvenience factory method that allows for parsing a document stored in the specified file.- Specified by:
createXMLStreamReaderin classorg.codehaus.stax2.XMLInputFactory2- Throws:
javax.xml.stream.XMLStreamException
-
configureForXmlConformance
public void configureForXmlConformance()
- Specified by:
configureForXmlConformancein classorg.codehaus.stax2.XMLInputFactory2
-
configureForConvenience
public void configureForConvenience()
- Specified by:
configureForConveniencein classorg.codehaus.stax2.XMLInputFactory2
-
configureForSpeed
public void configureForSpeed()
- Specified by:
configureForSpeedin classorg.codehaus.stax2.XMLInputFactory2
-
configureForLowMemUsage
public void configureForLowMemUsage()
- Specified by:
configureForLowMemUsagein classorg.codehaus.stax2.XMLInputFactory2
-
configureForRoundTripping
public void configureForRoundTripping()
- Specified by:
configureForRoundTrippingin classorg.codehaus.stax2.XMLInputFactory2
-
createAsyncForByteArray
public AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncForByteArray()
Description copied from class:AsyncXMLInputFactoryMethod for constructing a non-blockingXMLStreamReader2instance without any input data.- Specified by:
createAsyncForByteArrayin classAsyncXMLInputFactory- Returns:
- Non-blocking stream reader without any input
-
createAsyncFor
public AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncFor(byte[] input) throws javax.xml.stream.XMLStreamException
Description copied from class:AsyncXMLInputFactoryMethod for constructing a non-blockingXMLStreamReader2instance with specified initial input data. Input data will not be parsed at this point but merely fed to be parsed as needed with Stax API calls.Note that caller needs to ensure that given input buffer is available for parser to use until it has been fully consumed; parser is not required to make a copy of it, in order to minimize number of copies made. Caller can choose to just make a copy to pass. After input has been parsed buffer can be reused.
- Specified by:
createAsyncForin classAsyncXMLInputFactory- Returns:
- Non-blocking stream reader initialized with given input
- Throws:
javax.xml.stream.XMLStreamException
-
createAsyncFor
public AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncFor(byte[] input, int offset, int length) throws javax.xml.stream.XMLStreamException
Description copied from class:AsyncXMLInputFactoryMethod for constructing a non-blockingXMLStreamReader2instance with specified initial input data. Input data will not be parsed at this point but merely fed to be parsed as needed with Stax API calls.Note that caller needs to ensure that given input buffer is available for parser to use until it has been fully consumed; parser is not required to make a copy of it, in order to minimize number of copies made. Caller can choose to just make a copy to pass. After input has been parsed buffer can be reused.
- Specified by:
createAsyncForin classAsyncXMLInputFactory- Returns:
- Non-blocking stream reader initialized with given input
- Throws:
javax.xml.stream.XMLStreamException
-
createAsyncForByteBuffer
public AsyncXMLStreamReader<AsyncByteBufferFeeder> createAsyncForByteBuffer()
Description copied from class:AsyncXMLInputFactoryMethod for constructing a non-blockingXMLStreamReader2instance without any input data.- Specified by:
createAsyncForByteBufferin classAsyncXMLInputFactory- Returns:
- Non-blocking stream reader without any input
-
createAsyncFor
public AsyncXMLStreamReader<AsyncByteBufferFeeder> createAsyncFor(java.nio.ByteBuffer input) throws javax.xml.stream.XMLStreamException
Description copied from class:AsyncXMLInputFactoryMethod for constructing a non-blockingXMLStreamReader2instance with specified initial input data. Input data will not be parsed at this point but merely fed to be parsed as needed with Stax API calls.Note that caller needs to ensure that given input buffer is available for parser to use until it has been fully consumed; parser is not required to make a copy of it, in order to minimize number of copies made. Caller can choose to just make a copy to pass. After input has been parsed buffer can be reused.
- Specified by:
createAsyncForin classAsyncXMLInputFactory- Returns:
- Non-blocking stream reader initialized with given input
- Throws:
javax.xml.stream.XMLStreamException
-
getNonSharedConfig
public ReaderConfig getNonSharedConfig(java.lang.String systemId, java.lang.String publicId, java.lang.String extEncoding, boolean forEventReader, boolean forceAutoClose)
Method called when a non-shared copy of the current configuration is needed. This is usually done when a new reader is constructed.
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(java.io.InputStream in, java.lang.String enc, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(java.lang.String systemId, java.io.Reader r, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(java.lang.String systemId, java.io.InputStream in, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(javax.xml.transform.Source src, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR2
protected org.codehaus.stax2.XMLStreamReader2 constructSR2(org.codehaus.stax2.io.Stax2Source ss, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(java.net.URL src, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructSR
protected org.codehaus.stax2.XMLStreamReader2 constructSR(java.io.File f, boolean forEventReader) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
constructER
public org.codehaus.stax2.XMLEventReader2 constructER(org.codehaus.stax2.XMLStreamReader2 sr)
-
createEventAllocator
protected javax.xml.stream.util.XMLEventAllocator createEventAllocator()
-
-