org.xml.sax.XMLReader
implementation class. In JAXP 1.0, this class wrapped the
org.xml.sax.Parser
interface, however this interface was
replaced by the org.xml.sax.XMLReader
. For ease
of transition, this class continues to support the same name
and interface as well as supporting new methods.
An instance of this class can be obtained from the
javax.xml.parsers.SAXParserFactory#newSAXParser()
method.
Once an instance of this class is obtained, XML can be parsed from
a variety of input sources. These input sources are InputStreams,
Files, URLs, and SAX InputSources.This static method creates a new factory instance based on a system property setting or uses the platform default if no property has been defined.
The system property that controls which Factory implementation
to create is named "javax.xml.parsers.SAXParserFactory"
.
This property names a class that is a concrete subclass of this
abstract class. If no property is defined, a platform default
will be used.
org.xml.sax.HandlerBase
or the
org.xml.sax.helpers.DefaultHandler
are called.
Implementors of this class which wrap an underlying implementation
can consider using the org.
class to initially adapt their SAX1 implementation to work under
this revised class.
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public abstract Parser | |
public abstract Object | Returns: Value of the requested property.The name of the property to be retrieved. name)Returns the particular property requested for in the underlying
implementation of |
public Schema | |
public abstract XMLReader | Returns: The XMLReader that is encapsulated by the implementation of this class.Returns the |
public abstract boolean | Returns: true if this parser is configured to understand namespaces; false otherwise.Indicates whether or not this parser is configured to understand namespaces. |
public abstract boolean | Returns: true if this parser is configured to validate XML documents; false otherwise.Indicates whether or not this parser is configured to validate XML documents. |
public boolean | Returns: the return value of theSAXParserFactory#isXIncludeAware()
when this parser was created from factory.Get the XInclude processing mode for this parser. |
public void | parse(InputStream
InputStream containing the content to be parsed. is, HandlerBase The SAX HandlerBase to use. hb)
Deprecated
as a consequence of
HandlerBase being deprecated.
Parse the content of the given |
public void | parse(InputStream
InputStream containing the content to be parsed. is, HandlerBase The SAX HandlerBase to use. hb, String The systemId which is needed for resolving relative URIs. systemId)
Deprecated
as a consequence of
HandlerBase being deprecated.
Parse the content of the given |
public void | parse(InputStream
InputStream containing the content to be parsed. is, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content of the given |
public void | parse(InputStream
InputStream containing the content to be parsed. is, DefaultHandler The SAX DefaultHandler to use. dh, String The systemId which is needed for resolving relative URIs. systemId)Parse the content of the given |
public void | parse(String
The location of the content to be parsed. uri, HandlerBase The SAX HandlerBase to use. hb)
Deprecated
as a consequence of
Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
HandlerBase being deprecated.
org. .
|
public void | parse(String
The location of the content to be parsed. uri, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
|
public void | parse(File
The file containing the XML to parse f, HandlerBase The SAX HandlerBase to use. hb)
Deprecated
as a consequence of
Parse the content of the file specified as XML using the
specified HandlerBase being deprecated.
org. .
|
public void | parse(File
The file containing the XML to parse f, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content of the file specified as XML using the
specified |
public void | parse(InputSource
The InputSource containing the content to be parsed. is, HandlerBase The SAX HandlerBase to use. hb)
Deprecated
as a consequence of
Parse the content given HandlerBase being deprecated.
org.
as XML using the specified
org. .
|
public void | parse(InputSource
The InputSource containing the content to be parsed. is, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content given |
public void | |
public abstract void | setProperty(String
The name of the property to be set. name, Object The value of the property to be set. value)Sets the particular property in the underlying implementation of
|
SAXParser | back to summary |
---|---|
protected SAXParser() Protected constructor to prevent instantiation.
Use |
getParser | back to summary |
---|---|
public abstract Parser getParser() throws SAXException
Deprecated as a consequence of Returns the SAX parser that is encapsulated by the implementation of this class.
|
getProperty | back to summary |
---|---|
public abstract Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException Returns the particular property requested for in the underlying
implementation of
|
getSchema | back to summary |
---|---|
public Schema getSchema() Get a reference to the If no schema is being used,
|
getXMLReader | back to summary |
---|---|
public abstract XMLReader getXMLReader() throws SAXException Returns the
|
isNamespaceAware | back to summary |
---|---|
public abstract boolean isNamespaceAware() Indicates whether or not this parser is configured to understand namespaces.
|
isValidating | back to summary |
---|---|
public abstract boolean isValidating() Indicates whether or not this parser is configured to validate XML documents.
|
isXIncludeAware | back to summary |
---|---|
public boolean isXIncludeAware() Get the XInclude processing mode for this parser.
|
parse | back to summary |
---|---|
public void parse(InputStream is, HandlerBase hb) throws SAXException, IOException
Deprecated as a consequence of Parse the content of the given
|
parse | back to summary |
---|---|
public void parse(InputStream is, HandlerBase hb, String systemId) throws SAXException, IOException
Deprecated as a consequence of Parse the content of the given
|
parse | back to summary |
---|---|
public void parse(InputStream is, DefaultHandler dh) throws SAXException, IOException Parse the content of the given
|
parse | back to summary |
---|---|
public void parse(InputStream is, DefaultHandler dh, String systemId) throws SAXException, IOException Parse the content of the given
|
parse | back to summary |
---|---|
public void parse(String uri, HandlerBase hb) throws SAXException, IOException
Deprecated as a consequence of Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
|
parse | back to summary |
---|---|
public void parse(String uri, DefaultHandler dh) throws SAXException, IOException Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
|
parse | back to summary |
---|---|
public void parse(File f, HandlerBase hb) throws SAXException, IOException
Deprecated as a consequence of Parse the content of the file specified as XML using the
specified
|
parse | back to summary |
---|---|
public void parse(File f, DefaultHandler dh) throws SAXException, IOException Parse the content of the file specified as XML using the
specified
|
parse | back to summary |
---|---|
public void parse(InputSource is, HandlerBase hb) throws SAXException, IOException
Deprecated as a consequence of Parse the content given
|
parse | back to summary |
---|---|
public void parse(InputSource is, DefaultHandler dh) throws SAXException, IOException Parse the content given
|
reset | back to summary |
---|---|
public void reset() Reset this
The reset
|
setProperty | back to summary |
---|---|
public abstract void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException Sets the particular property in the underlying implementation of
All implementations that implement JAXP 1.5 or newer are required to
support the
|