Class AsyncXMLInputFactory

java.lang.Object
javax.xml.stream.XMLInputFactory
org.codehaus.stax2.XMLInputFactory2
com.fasterxml.aalto.AsyncXMLInputFactory
All Implemented Interfaces:
org.codehaus.stax2.XMLStreamProperties
Direct Known Subclasses:
InputFactoryImpl

public abstract class AsyncXMLInputFactory extends org.codehaus.stax2.XMLInputFactory2
Extension of XMLInputFactory2 to provide factory methods for constructing non-blocking (asynchronous) parsers (of type AsyncXMLStreamReader.
  • Constructor Details

    • AsyncXMLInputFactory

      public AsyncXMLInputFactory()
  • Method Details

    • createAsyncForByteArray

      public abstract AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncForByteArray()
      Method for constructing a non-blocking XMLStreamReader2 instance without any input data.
      Returns:
      Non-blocking stream reader without any input
    • createAsyncFor

      public abstract AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncFor(byte[] input) throws XMLStreamException
      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.

      Returns:
      Non-blocking stream reader initialized with given input
      Throws:
      XMLStreamException
    • createAsyncFor

      public abstract AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncFor(byte[] input, int offset, int length) throws XMLStreamException
      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.

      Returns:
      Non-blocking stream reader initialized with given input
      Throws:
      XMLStreamException
    • createAsyncForByteBuffer

      public abstract AsyncXMLStreamReader<AsyncByteBufferFeeder> createAsyncForByteBuffer()
      Method for constructing a non-blocking XMLStreamReader2 instance without any input data.
      Returns:
      Non-blocking stream reader without any input
    • createAsyncFor

      public abstract AsyncXMLStreamReader<AsyncByteBufferFeeder> createAsyncFor(ByteBuffer input) throws XMLStreamException
      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.

      Returns:
      Non-blocking stream reader initialized with given input
      Throws:
      XMLStreamException