Package com.sun.xml.rpc.sp
Class StreamingParserFactory
- java.lang.Object
-
- com.sun.xml.rpc.sp.StreamingParserFactory
-
- Direct Known Subclasses:
StreamingParserFactoryImpl
public abstract class StreamingParserFactory extends Object
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 Modifier Constructor Description protectedStreamingParserFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanisCoalescing()Returns the coalescing property of this factory.abstract booleanisNamespaceAware()Returns the namespaceAware property of this factory.abstract booleanisValidating()Returns the validating property of this factory.static StreamingParserFactorynewInstance()Creates a new factory of demand-driven parsers.abstract StreamingParsernewParser(File file)Creates 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.
-
-
-
Method Detail
-
newInstance
public static StreamingParserFactory 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
public abstract StreamingParser newParser(InputStream in)
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
public abstract 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; 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
-
-