public final class Parser extends SAXParser implements Locator
DefaultHandler| Modifier and Type | Field and Description |
|---|---|
static char |
EOS
The end of stream character.
|
static String |
FAULT |
| Constructor and Description |
|---|
Parser(boolean nsaware)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnNumber()
Return the column number where the current document event ends.
|
int |
getLineNumber()
Return the line number where the current document event ends.
|
String |
getPublicId()
Return the public identifier for the current document event.
|
String |
getSystemId()
Return the system identifier for the current document event.
|
boolean |
isNamespaceAware()
Indicates whether or not this parser is configured to
understand namespaces.
|
boolean |
isValidating()
Indicates whether or not this parser is configured to validate
XML documents.
|
void |
parse(InputSource is,
DefaultHandler handler)
Parse the content given
InputSource
as XML using the specified
DefaultHandler. |
void |
parse(InputStream src,
DefaultHandler handler)
Parse the content of the given
InputStream
instance as XML using the specified
DefaultHandler. |
public static final String FAULT
public static final char EOS
public String getPublicId()
The return value is the public identifier of the document entity or of the external parsed entity in which the markup triggering the event appears.
getPublicId in interface LocatorgetSystemId()public String getSystemId()
The return value is the system identifier of the document entity or of the external parsed entity in which the markup triggering the event appears.
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
getSystemId in interface LocatorgetPublicId()public int getLineNumber()
getLineNumber in interface LocatorgetColumnNumber()public int getColumnNumber()
getColumnNumber in interface LocatorgetLineNumber()public boolean isNamespaceAware()
isNamespaceAware in class SAXParserpublic boolean isValidating()
isValidating in class SAXParserpublic void parse(InputStream src, DefaultHandler handler) throws SAXException, IOException
InputStream
instance as XML using the specified
DefaultHandler.parse in class SAXParsersrc - InputStream containing the content to be parsed.handler - The SAX DefaultHandler to use.IOException - If any IO errors occur.IllegalArgumentException - If the given InputStream or handler is null.SAXException - If the underlying parser throws a
SAXException while parsing.DefaultHandlerpublic void parse(InputSource is, DefaultHandler handler) throws SAXException, IOException
InputSource
as XML using the specified
DefaultHandler.parse in class SAXParseris - The InputSource containing the content to be parsed.handler - The SAX DefaultHandler to use.IOException - If any IO errors occur.IllegalArgumentException - If the InputSource or handler is null.SAXException - If the underlying parser throws a
SAXException while parsing.DefaultHandlerCopyright © 2012 code4tv.com. All Rights Reserved.