Package com.sun.xml.rpc.sp
Class StreamingParserFactory
java.lang.Object
com.sun.xml.rpc.sp.StreamingParserFactory
- Direct Known Subclasses:
StreamingParserFactoryImpl
Factory class for creating demand-driven parsers.
In typical use an instance of this class is created and configured, and then
it is used to create parser instances as required, like so:
StreamingParserFactory spf
= StreamingParserFactory.newInstance();
pf.setValidating(true);
pf.setCoalescing(false);
StreamingParser sp = spf.newParser(in);- Author:
- Mark Reinhold, JAX-RPC RI Development Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanReturns the coalescing property of this factory.abstract booleanReturns the namespaceAware property of this factory.abstract booleanReturns the validating property of this factory.static StreamingParserFactoryCreates a new factory of demand-driven parsers.abstract StreamingParserCreates a new demand-driven parser that reads from the given file.abstract StreamingParsernewParser(InputStream in) Creates a new parser instance that reads from the given input stream.abstract voidsetCoalescing(boolean coalescing) Sets the coalescing property of this factory.abstract voidsetNamespaceAware(boolean namespaceAware) Sets the namespaceAware property of this factory.abstract voidsetValidating(boolean validating) Sets the validating property of this factory.
-
Constructor Details
-
StreamingParserFactory
protected StreamingParserFactory()
-
-
Method Details
-
newInstance
Creates a new factory of demand-driven parsers. -
setValidating
public abstract void setValidating(boolean validating) Sets the validating property of this factory.- 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 abstract boolean isValidating()Returns the validating property of this factory.- Returns:
- true if, and only if, all parsers henceforth created by this factory will perform validation
-
setCoalescing
public abstract 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., theStreamingParser.CHARSstate will never occur more than once in sequence.- 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 abstract boolean isCoalescing()Returns the coalescing property of this factory.- Returns:
- true if, and only if, all parsers henceforth created by this factory will coalesce adjacent runs of character data
-
setNamespaceAware
public abstract void setNamespaceAware(boolean namespaceAware) Sets the namespaceAware property of this factory.- 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 abstract boolean isNamespaceAware()Returns the namespaceAware property of this factory.- Returns:
- true if, and only if, all parsers henceforth created by this factory will support namespace
-
newParser
Creates a new parser instance that reads from the given input stream. No parsing is done by this method; theparsemethod of the resulting parser must be invoked to parse the initial component of the input document.- Parameters:
in- The input stream from which the XML document will be read
-
newParser
Creates a new demand-driven parser that reads from the given file. No parsing is done by this constructor; theparsemethod must be invoked to parse the initial component of the given document.- Parameters:
file- The file from which the XML document will be read- Throws:
IOException- If an I/O error occurs
-