Class 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).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.xml.stream.util.XMLEventAllocator _allocator  
      (package private) ReaderConfig _config
      This 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
      • 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
    • 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
    • Constructor Detail

      • InputFactoryImpl

        public InputFactoryImpl()
    • Method Detail

      • createFilteredReader

        public javax.xml.stream.XMLEventReader createFilteredReader​(javax.xml.stream.XMLEventReader reader,
                                                                    javax.xml.stream.EventFilter filter)
        Specified by:
        createFilteredReader in class javax.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:
        createFilteredReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLEventReader in class javax.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:
        createXMLStreamReader in class javax.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:
        createXMLStreamReader in class javax.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:
        createXMLStreamReader in class javax.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:
        createXMLStreamReader in class javax.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:
        createXMLStreamReader in class javax.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:
        createXMLStreamReader in class javax.xml.stream.XMLInputFactory
        Throws:
        javax.xml.stream.XMLStreamException
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
        Specified by:
        getProperty in class javax.xml.stream.XMLInputFactory
      • setProperty

        public void setProperty​(java.lang.String propName,
                                java.lang.Object value)
        Specified by:
        setProperty in class javax.xml.stream.XMLInputFactory
      • getEventAllocator

        public javax.xml.stream.util.XMLEventAllocator getEventAllocator()
        Specified by:
        getEventAllocator in class javax.xml.stream.XMLInputFactory
      • getXMLReporter

        public javax.xml.stream.XMLReporter getXMLReporter()
        Specified by:
        getXMLReporter in class javax.xml.stream.XMLInputFactory
      • getXMLResolver

        public javax.xml.stream.XMLResolver getXMLResolver()
        Specified by:
        getXMLResolver in class javax.xml.stream.XMLInputFactory
      • isPropertySupported

        public boolean isPropertySupported​(java.lang.String name)
        Specified by:
        isPropertySupported in class javax.xml.stream.XMLInputFactory
      • setEventAllocator

        public void setEventAllocator​(javax.xml.stream.util.XMLEventAllocator allocator)
        Specified by:
        setEventAllocator in class javax.xml.stream.XMLInputFactory
      • setXMLReporter

        public void setXMLReporter​(javax.xml.stream.XMLReporter r)
        Specified by:
        setXMLReporter in class javax.xml.stream.XMLInputFactory
      • setXMLResolver

        public void setXMLResolver​(javax.xml.stream.XMLResolver r)
        Specified by:
        setXMLResolver in class javax.xml.stream.XMLInputFactory
      • createXMLEventReader

        public org.codehaus.stax2.XMLEventReader2 createXMLEventReader​(java.net.URL src)
                                                                throws javax.xml.stream.XMLStreamException
        Specified by:
        createXMLEventReader in class org.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:
        createXMLEventReader in class org.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:
        createXMLStreamReader in class org.codehaus.stax2.XMLInputFactory2
        Throws:
        javax.xml.stream.XMLStreamException
      • createXMLStreamReader

        public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader​(java.io.File f)
                                                                  throws javax.xml.stream.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:
        javax.xml.stream.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
      • createAsyncFor

        public AsyncXMLStreamReader<AsyncByteArrayFeeder> createAsyncFor​(byte[] input)
                                                                  throws javax.xml.stream.XMLStreamException
        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:
        createAsyncFor in class AsyncXMLInputFactory
        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: 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:
        createAsyncFor in class AsyncXMLInputFactory
        Returns:
        Non-blocking stream reader initialized with given input
        Throws:
        javax.xml.stream.XMLStreamException
      • createAsyncFor

        public AsyncXMLStreamReader<AsyncByteBufferFeeder> createAsyncFor​(java.nio.ByteBuffer input)
                                                                   throws javax.xml.stream.XMLStreamException
        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:
        createAsyncFor in class AsyncXMLInputFactory
        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()