Package com.sun.xml.rpc.sp
Class StreamingParserImpl
- java.lang.Object
-
- com.sun.xml.rpc.sp.StreamingParser
-
- com.sun.xml.rpc.sp.StreamingParserImpl
-
public final class StreamingParserImpl extends StreamingParser
A demand-driven streaming parser implementation.- Author:
- Zhenghua Li, JAX-RPC RI Development Team
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcolumn()Returns the column number of the current component, or -1 if the column number is not known.Stringdescribe(boolean articleNeeded)Constructs a string describing the current state of this parser, suitable for use in an error message or an exception detail string.booleanisCoalescing()Returns the coalescing property of this parser.booleanisNamespaceAware()Returns the namespaceAware property of this parser.booleanisValidating()Returns the validating property of this parser.intline()Returns the line number of the current component, or -1 if the line number is not known.Stringname()Returns a name string whose meaning depends upon the current state.intparse()Parses the next component of the document being parsed.StringpublicId()Returns the public identifer of the document being parsed, or null if it has none.intstate()Returns the current state of the parser.StringsystemId()Returns the system identifer of the document being parsed, or null if it has none.StringuriString()Returns the URI string of the current component.Stringvalue()Returns a value string whose meaning depends upon the current state.-
Methods inherited from class com.sun.xml.rpc.sp.StreamingParser
describe, toString
-
-
-
-
Method Detail
-
parse
public int parse() throws ParseException, IOExceptionParses the next component of the document being parsed.- Specified by:
parsein classStreamingParser- Returns:
- The parser's current state, one of
StreamingParser.START,StreamingParser.END,StreamingParser.ATTR,StreamingParser.CHARS,StreamingParser.IWS, orStreamingParser.PI, or -1 if the end of the document has been reached - Throws:
ParseException- If an XML parsing error occursIOException- If an I/O error occurs
-
state
public int state()
Returns the current state of the parser.- Specified by:
statein classStreamingParser- Returns:
- The parser's current state, one of
StreamingParser.START,StreamingParser.END,StreamingParser.ATTR,StreamingParser.CHARS,StreamingParser.IWS, orStreamingParser.PI, or -1 if the end of the document has been reached. - Throws:
IllegalStateException- If the parser has yet not been started by invoking theparse()method
-
name
public String name()
Returns a name string whose meaning depends upon the current state.- Specified by:
namein classStreamingParser- Throws:
IllegalStateException- If there is no name data for the current parser state
-
value
public String value()
Returns a value string whose meaning depends upon the current state.- Specified by:
valuein classStreamingParser- Throws:
IllegalStateException- If there is no value data for the current parser state
-
uriString
public String uriString()
Returns the URI string of the current component.- Specified by:
uriStringin classStreamingParser- Throws:
IllegalStateException- If there is no URI for the current component
-
line
public int line()
Returns the line number of the current component, or -1 if the line number is not known.- Specified by:
linein classStreamingParser
-
column
public int column()
Returns the column number of the current component, or -1 if the column number is not known.- Specified by:
columnin classStreamingParser
-
publicId
public String publicId()
Returns the public identifer of the document being parsed, or null if it has none.- Specified by:
publicIdin classStreamingParser
-
systemId
public String systemId()
Returns the system identifer of the document being parsed, or null if it has none.- Specified by:
systemIdin classStreamingParser
-
isValidating
public boolean isValidating()
Returns the validating property of this parser.- Specified by:
isValidatingin classStreamingParser- Returns:
- true if, and only if, this parser will perform validation
-
isCoalescing
public boolean isCoalescing()
Returns the coalescing property of this parser.- Specified by:
isCoalescingin classStreamingParser- Returns:
- true if, and only if, this parser will coalesce adjacent runs of character data
-
isNamespaceAware
public boolean isNamespaceAware()
Returns the namespaceAware property of this parser.- Specified by:
isNamespaceAwarein classStreamingParser- Returns:
- true if, and only if, this parser will support namespace
-
describe
public String describe(boolean articleNeeded)
Constructs a string describing the current state of this parser, suitable for use in an error message or an exception detail string.- Specified by:
describein classStreamingParser- Parameters:
articleNeeded- Whether an appropriate article ("a", "an", "some", or "the") is to be prepended to the description string- Returns:
- A string describing the given parser state.
-
-