com.fasterxml.aalto.stax
Class InputFactoryImpl

java.lang.Object
  extended by javax.xml.stream.XMLInputFactory
      extended by org.codehaus.stax2.XMLInputFactory2
          extended by com.fasterxml.aalto.AsyncXMLInputFactory
              extended by com.fasterxml.aalto.stax.InputFactoryImpl
All Implemented Interfaces:
org.codehaus.stax2.XMLStreamProperties

public final class InputFactoryImpl
extends AsyncXMLInputFactory

Aalto implementation of basic Stax factory (both XMLInputFactory and XMLInputFactory2) as well as API for producing non-blocking (async) parsers (that is, AsyncXMLInputFactory).

Author:
Tatu Saloranta

Field Summary
protected  XMLEventAllocator _allocator
           
 
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
 
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
 
Fields inherited from interface org.codehaus.stax2.XMLStreamProperties
XSP_IMPLEMENTATION_NAME, XSP_IMPLEMENTATION_VERSION, XSP_NAMESPACE_AWARE, XSP_PROBLEM_REPORTER, XSP_SUPPORT_XMLID, XSP_SUPPORTS_XML11, XSP_V_XMLID_FULL, XSP_V_XMLID_NONE, XSP_V_XMLID_TYPING
 
Constructor Summary
InputFactoryImpl()
           
 
Method Summary
 void configureForConvenience()
           
 void configureForLowMemUsage()
           
 void configureForRoundTripping()
           
 void configureForSpeed()
           
 void configureForXmlConformance()
           
 org.codehaus.stax2.XMLEventReader2 constructER(org.codehaus.stax2.XMLStreamReader2 sr)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(File f, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(InputStream in, String enc, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(Source src, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(String systemId, InputStream in, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(String systemId, Reader r, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR(URL src, boolean forEventReader)
           
protected  org.codehaus.stax2.XMLStreamReader2 constructSR2(org.codehaus.stax2.io.Stax2Source ss, boolean forEventReader)
           
 AsyncXMLStreamReader createAsyncXMLStreamReader()
          Method for constructing a non-blocking XMLStreamReader2 instance without any input data.
 AsyncXMLStreamReader createAsyncXMLStreamReader(byte[] input)
          Method for constructing a non-blocking XMLStreamReader2 instance with specified initial input data.
 AsyncXMLStreamReader createAsyncXMLStreamReader(byte[] input, int offset, int length)
          Method for constructing a non-blocking XMLStreamReader2 instance with specified initial input data.
protected  XMLEventAllocator createEventAllocator()
           
 XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter)
           
 XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter)
           
 org.codehaus.stax2.XMLEventReader2 createXMLEventReader(File f)
           
 XMLEventReader createXMLEventReader(InputStream in)
           
 XMLEventReader createXMLEventReader(InputStream in, String enc)
           
 XMLEventReader createXMLEventReader(Reader r)
           
 XMLEventReader createXMLEventReader(Source source)
           
 XMLEventReader createXMLEventReader(String systemId, InputStream in)
           
 XMLEventReader createXMLEventReader(String systemId, Reader r)
           
 org.codehaus.stax2.XMLEventReader2 createXMLEventReader(URL src)
           
 XMLEventReader createXMLEventReader(XMLStreamReader sr)
           
 org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(File f)
          Convenience factory method that allows for parsing a document stored in the specified file.
 XMLStreamReader createXMLStreamReader(InputStream in)
           
 XMLStreamReader createXMLStreamReader(InputStream in, String enc)
           
 XMLStreamReader createXMLStreamReader(Reader r)
           
 XMLStreamReader createXMLStreamReader(Source src)
           
 XMLStreamReader createXMLStreamReader(String systemId, InputStream in)
           
 XMLStreamReader createXMLStreamReader(String systemId, Reader r)
           
 org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(URL src)
           
 XMLEventAllocator getEventAllocator()
           
 ReaderConfig getNonSharedConfig(String systemId, String publicId, String extEncoding, boolean forEventReader, boolean forceAutoClose)
          Method called when a non-shared copy of the current configuration is needed.
 Object getProperty(String name)
           
 XMLReporter getXMLReporter()
           
 XMLResolver getXMLResolver()
           
 boolean isPropertySupported(String name)
           
 void setEventAllocator(XMLEventAllocator allocator)
           
 void setProperty(String propName, Object value)
           
 void setXMLReporter(XMLReporter r)
           
 void setXMLResolver(XMLResolver r)
           
 
Methods inherited from class javax.xml.stream.XMLInputFactory
newFactory, newFactory, newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_allocator

protected XMLEventAllocator _allocator
Constructor Detail

InputFactoryImpl

public InputFactoryImpl()
Method Detail

createFilteredReader

public XMLEventReader createFilteredReader(XMLEventReader reader,
                                           EventFilter filter)
Specified by:
createFilteredReader in class XMLInputFactory

createFilteredReader

public XMLStreamReader createFilteredReader(XMLStreamReader reader,
                                            StreamFilter filter)
                                     throws XMLStreamException
Specified by:
createFilteredReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(InputStream in)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(InputStream in,
                                           String enc)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(Reader r)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(Source source)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(String systemId,
                                           InputStream in)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(String systemId,
                                           Reader r)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLEventReader

public XMLEventReader createXMLEventReader(XMLStreamReader sr)
                                    throws XMLStreamException
Specified by:
createXMLEventReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(InputStream in)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(InputStream in,
                                             String enc)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(Reader r)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(String systemId,
                                             Reader r)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(Source src)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

createXMLStreamReader

public XMLStreamReader createXMLStreamReader(String systemId,
                                             InputStream in)
                                      throws XMLStreamException
Specified by:
createXMLStreamReader in class XMLInputFactory
Throws:
XMLStreamException

getProperty

public Object getProperty(String name)
Specified by:
getProperty in class XMLInputFactory

setProperty

public void setProperty(String propName,
                        Object value)
Specified by:
setProperty in class XMLInputFactory

getEventAllocator

public XMLEventAllocator getEventAllocator()
Specified by:
getEventAllocator in class XMLInputFactory

getXMLReporter

public XMLReporter getXMLReporter()
Specified by:
getXMLReporter in class XMLInputFactory

getXMLResolver

public XMLResolver getXMLResolver()
Specified by:
getXMLResolver in class XMLInputFactory

isPropertySupported

public boolean isPropertySupported(String name)
Specified by:
isPropertySupported in class XMLInputFactory

setEventAllocator

public void setEventAllocator(XMLEventAllocator allocator)
Specified by:
setEventAllocator in class XMLInputFactory

setXMLReporter

public void setXMLReporter(XMLReporter r)
Specified by:
setXMLReporter in class XMLInputFactory

setXMLResolver

public void setXMLResolver(XMLResolver r)
Specified by:
setXMLResolver in class XMLInputFactory

createXMLEventReader

public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(URL src)
                                                        throws XMLStreamException
Specified by:
createXMLEventReader in class org.codehaus.stax2.XMLInputFactory2
Throws:
XMLStreamException

createXMLEventReader

public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(File f)
                                                        throws XMLStreamException
Specified by:
createXMLEventReader in class org.codehaus.stax2.XMLInputFactory2
Throws:
XMLStreamException

createXMLStreamReader

public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(URL src)
                                                          throws XMLStreamException
Specified by:
createXMLStreamReader in class org.codehaus.stax2.XMLInputFactory2
Throws:
XMLStreamException

createXMLStreamReader

public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(File f)
                                                          throws XMLStreamException
Convenience factory method that allows for parsing a document stored in the specified file.

Specified by:
createXMLStreamReader in class org.codehaus.stax2.XMLInputFactory2
Throws:
XMLStreamException

configureForXmlConformance

public void configureForXmlConformance()
Specified by:
configureForXmlConformance in class org.codehaus.stax2.XMLInputFactory2

configureForConvenience

public void configureForConvenience()
Specified by:
configureForConvenience in class org.codehaus.stax2.XMLInputFactory2

configureForSpeed

public void configureForSpeed()
Specified by:
configureForSpeed in class org.codehaus.stax2.XMLInputFactory2

configureForLowMemUsage

public void configureForLowMemUsage()
Specified by:
configureForLowMemUsage in class org.codehaus.stax2.XMLInputFactory2

configureForRoundTripping

public void configureForRoundTripping()
Specified by:
configureForRoundTripping in class org.codehaus.stax2.XMLInputFactory2

createAsyncXMLStreamReader

public AsyncXMLStreamReader createAsyncXMLStreamReader()
Description copied from class: AsyncXMLInputFactory
Method for constructing a non-blocking XMLStreamReader2 instance without any input data.

Specified by:
createAsyncXMLStreamReader in class AsyncXMLInputFactory
Returns:
Non-blocking stream reader without any input

createAsyncXMLStreamReader

public AsyncXMLStreamReader createAsyncXMLStreamReader(byte[] input)
Description copied from class: AsyncXMLInputFactory
Method for constructing a non-blocking XMLStreamReader2 instance 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:
createAsyncXMLStreamReader in class AsyncXMLInputFactory
Returns:
Non-blocking stream reader initialized with given input

createAsyncXMLStreamReader

public AsyncXMLStreamReader createAsyncXMLStreamReader(byte[] input,
                                                       int offset,
                                                       int length)
Description copied from class: AsyncXMLInputFactory
Method for constructing a non-blocking XMLStreamReader2 instance 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:
createAsyncXMLStreamReader in class AsyncXMLInputFactory
Returns:
Non-blocking stream reader initialized with given input

getNonSharedConfig

public ReaderConfig getNonSharedConfig(String systemId,
                                       String publicId,
                                       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(InputStream in,
                                                          String enc,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructSR

protected org.codehaus.stax2.XMLStreamReader2 constructSR(String systemId,
                                                          Reader r,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructSR

protected org.codehaus.stax2.XMLStreamReader2 constructSR(String systemId,
                                                          InputStream in,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructSR

protected org.codehaus.stax2.XMLStreamReader2 constructSR(Source src,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructSR2

protected org.codehaus.stax2.XMLStreamReader2 constructSR2(org.codehaus.stax2.io.Stax2Source ss,
                                                           boolean forEventReader)
                                                    throws XMLStreamException
Throws:
XMLStreamException

constructSR

protected org.codehaus.stax2.XMLStreamReader2 constructSR(URL src,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructSR

protected org.codehaus.stax2.XMLStreamReader2 constructSR(File f,
                                                          boolean forEventReader)
                                                   throws XMLStreamException
Throws:
XMLStreamException

constructER

public org.codehaus.stax2.XMLEventReader2 constructER(org.codehaus.stax2.XMLStreamReader2 sr)

createEventAllocator

protected XMLEventAllocator createEventAllocator()


Copyright © 2012 Fasterxml.com. All Rights Reserved.