Class StreamingParserFactoryImpl


  • public class StreamingParserFactoryImpl
    extends StreamingParserFactory
    Implementation of the factory class for creating demand-driven parsers.
    Author:
    Zhenghua Li, JAX-RPC RI Development Team
    • Constructor Detail

      • StreamingParserFactoryImpl

        public StreamingParserFactoryImpl()
        The constructor is made public now to allow access from javax.xml.marshal.
    • Method Detail

      • setValidating

        public void setValidating​(boolean validating)
        Sets the validating property of this factory.
        Specified by:
        setValidating in class StreamingParserFactory
        Parameters:
        validating - Parsers henceforth created by this factory will perform validation if, and only if, this parameter is true
        Throws:
        UnsupportedOperationException - If the parser implementation does not support the requested value
      • isValidating

        public boolean isValidating()
        Returns the validating property of this factory.
        Specified by:
        isValidating in class StreamingParserFactory
        Returns:
        true if, and only if, all parsers henceforth created by this factory will perform validation
      • setCoalescing

        public void setCoalescing​(boolean coalescing)
        Sets the coalescing property of this factory. If coalescing is enabled then the parser will always coalesce adjacent runs of character data, i.e., the StreamingParser.CHARS state will never occur more than once in sequence.
        Specified by:
        setCoalescing in class StreamingParserFactory
        Parameters:
        coalescing - Parsers henceforth created by this factory will coalesce character data if, and only if, this parameter is true
        Throws:
        UnsupportedOperationException - If the parser implementation does not support the requested value
      • isCoalescing

        public boolean isCoalescing()
        Returns the coalescing property of this factory.
        Specified by:
        isCoalescing in class StreamingParserFactory
        Returns:
        true if, and only if, all parsers henceforth created by this factory will coalesce adjacent runs of character data
      • setNamespaceAware

        public void setNamespaceAware​(boolean namespaceAware)
        Sets the namespaceAware property of this factory.
        Specified by:
        setNamespaceAware in class StreamingParserFactory
        Parameters:
        namespaceAware - Parsers henceforth created by this factory will support namespace if, and only if, this parameter is true
        Throws:
        UnsupportedOperationException - If the parser implementation does not support the requested value
      • isNamespaceAware

        public boolean isNamespaceAware()
        Returns the namespaceAware property of this factory.
        Specified by:
        isNamespaceAware in class StreamingParserFactory
        Returns:
        true if, and only if, all parsers henceforth created by this factory will support namespace
      • newParser

        public StreamingParser newParser​(InputStream in)
        Creates a new parser instance that reads from the given input stream. No parsing is done by this method; the parse method of the resulting parser must be invoked to parse the initial component of the input document.
        Specified by:
        newParser in class StreamingParserFactory
        Parameters:
        in - The input stream from which the XML document will be read
      • newParser

        public StreamingParser newParser​(File file)
                                  throws IOException
        Creates a new demand-driven parser that reads from the given file. No parsing is done by this constructor; the parse method must be invoked to parse the initial component of the given document.
        Specified by:
        newParser in class StreamingParserFactory
        Parameters:
        file - The file from which the XML document will be read
        Throws:
        IOException - If an I/O error occurs