javax.xml.parsers
Class SAXParser
java.lang.Object
|
+--javax.xml.parsers.SAXParser
public abstract class
SAXParserextends
Object Wraps a SAX2 (or SAX1) parser.
Note that parsing with methods on this interface requires use of one
of the optional SAX base classes. It's usually preferable to use the
SAX parser APIs directly. SAX gives much more flexibility about how
application classes are organized, and about how the document entity is
packaged for delivery to the parser. And JAXP doesn't otherwise provide
access to the SAX2 extension handlers for lexical or declaration events.
Authors:- Andrew Selkirk
- David Brownell
org.xml.sax.Parser | getParser()
|
java.lang.Object | getProperty(java.lang.String id)
|
org.xml.sax.XMLReader | getXMLReader()
|
boolean | isNamespaceAware()
|
boolean | isValidating()
|
void | parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler)
|
void | parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler, java.lang.String systemID)
|
void | parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def)
|
void | parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def, java.lang.String systemID)
|
void | parse(java.lang.String uri, org.xml.sax.HandlerBase handler)
|
void | parse(java.lang.String uri, org.xml.sax.helpers.DefaultHandler def)
|
void | parse(java.io.File file, org.xml.sax.HandlerBase handler)
|
void | parse(java.io.File file, org.xml.sax.helpers.DefaultHandler def)
|
void | parse(org.xml.sax.InputSource source, org.xml.sax.HandlerBase handler)
|
void | parse(org.xml.sax.InputSource source, org.xml.sax.helpers.DefaultHandler def)
|
void | setProperty(java.lang.String id, java.lang.Object value)
|
SAXParser
protected SAXParser()
Only subclasses may use the constructor.
getParser
public Parser getParser()
Get a (deprecated) SAX1 driver for the underlying parser.
getProperty
public Object getProperty(java.lang.String id)
Parameters:
getXMLReader
public XMLReader getXMLReader()
Get a SAX2 driver for the underlying parser.
isNamespaceAware
public boolean isNamespaceAware()
isValidating
public boolean isValidating()
parse
public void parse(java.io.File file, org.xml.sax.HandlerBase handler)
Parse using (deprecated) SAX1 style handlers,
turning a file name into the document URI.
Parameters:
parse
public void parse(java.io.File file, org.xml.sax.helpers.DefaultHandler def)
Parse using SAX2 style handlers,
turning a file name into the document URI.
Parameters:
parse
public void parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler)
Parse using (deprecated) SAX1 style handlers,
and a byte stream (with no URI).
Avoid using this API, since relative URIs in the document need
to be resolved against the document entity's URI, and good
diagnostics also need that URI.
Parameters:
parse
public void parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler, java.lang.String systemID)
Parse using (deprecated) SAX1 style handlers,
and a byte stream with a specified URI.
Parameters:
parse
public void parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def)
Parse using SAX2 style handlers,
and a byte stream (with no URI).
Avoid using this API, since relative URIs in the document need
to be resolved against the document entity's URI, and good
diagnostics also need that URI.
Parameters:
parse
public void parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def, java.lang.String systemID)
Parse using SAX2 style handlers,
and a byte stream with a specified URI.
Parameters:
parse
public void parse(java.lang.String uri, org.xml.sax.HandlerBase handler)
Parse using (deprecated) SAX1 style handlers,
and a URI for the document entity.
Parameters:
parse
public void parse(java.lang.String uri, org.xml.sax.helpers.DefaultHandler def)
Parse using SAX2 style handlers,
and a URI for the document entity.
Parameters:
parse
public void parse(org.xml.sax.InputSource source, org.xml.sax.HandlerBase handler)
Parse using (deprecated) SAX1 style handlers.
Parameters:
parse
public void parse(org.xml.sax.InputSource source, org.xml.sax.helpers.DefaultHandler def)
Parse using SAX2 style handlers.
Parameters:
setProperty
public void setProperty(java.lang.String id, java.lang.Object value)
Parameters:
Note that parsing with methods on this interface requires use of one of the optional SAX base classes. It's usually preferable to use the SAX parser APIs directly. SAX gives much more flexibility about how application classes are organized, and about how the document entity is packaged for delivery to the parser. And JAXP doesn't otherwise provide access to the SAX2 extension handlers for lexical or declaration events.