Methods Summary |
---|
public abstract org.xml.sax.Parser | getParser()Returns the SAX parser that is encapsultated by the
implementation of this class.
|
public abstract java.lang.Object | getProperty(java.lang.String name)Returns the particular property requested for in the underlying
implementation of {@link org.xml.sax.XMLReader}.
|
public javax.xml.validation.Schema | getSchema()Get a reference to the the {@link Schema} being used by
the XML processor.
If no schema is being used, null is returned.
throw new UnsupportedOperationException(
"This parser does not support specification \""
+ this.getClass().getPackage().getSpecificationTitle()
+ "\" version \""
+ this.getClass().getPackage().getSpecificationVersion()
+ "\""
);
|
public abstract org.xml.sax.XMLReader | getXMLReader()Returns the {@link org.xml.sax.XMLReader} that is encapsulated by the
implementation of this class.
|
public abstract boolean | isNamespaceAware()Indicates whether or not this parser is configured to
understand namespaces.
|
public abstract boolean | isValidating()Indicates whether or not this parser is configured to
validate XML documents.
|
public boolean | isXIncludeAware()Get the XInclude processing mode for this parser.
throw new UnsupportedOperationException(
"This parser does not support specification \""
+ this.getClass().getPackage().getSpecificationTitle()
+ "\" version \""
+ this.getClass().getPackage().getSpecificationVersion()
+ "\""
);
|
public void | parse(java.io.File f, org.xml.sax.helpers.DefaultHandler dh)Parse the content of the file specified as XML using the
specified {@link org.xml.sax.helpers.DefaultHandler}.
if (f == null) {
throw new IllegalArgumentException("File cannot be null");
}
//convert file to appropriate URI, f.toURI().toASCIIString()
//converts the URI to string as per rule specified in
//RFC 2396,
InputSource input = new InputSource(f.toURI().toASCIIString());
this.parse(input, dh);
|
public void | parse(org.xml.sax.InputSource is, org.xml.sax.HandlerBase hb)Parse the content given {@link org.xml.sax.InputSource}
as XML using the specified
{@link org.xml.sax.HandlerBase}.
Use of the DefaultHandler version of this method is recommended as
the HandlerBase class has been deprecated in SAX 2.0
if (is == null) {
throw new IllegalArgumentException("InputSource cannot be null");
}
Parser parser = this.getParser();
if (hb != null) {
parser.setDocumentHandler(hb);
parser.setEntityResolver(hb);
parser.setErrorHandler(hb);
parser.setDTDHandler(hb);
}
parser.parse(is);
|
public void | parse(org.xml.sax.InputSource is, org.xml.sax.helpers.DefaultHandler dh)Parse the content given {@link org.xml.sax.InputSource}
as XML using the specified
{@link org.xml.sax.helpers.DefaultHandler}.
if (is == null) {
throw new IllegalArgumentException("InputSource cannot be null");
}
XMLReader reader = this.getXMLReader();
if (dh != null) {
reader.setContentHandler(dh);
reader.setEntityResolver(dh);
reader.setErrorHandler(dh);
reader.setDTDHandler(dh);
}
reader.parse(is);
|
public void | parse(java.io.InputStream is, org.xml.sax.HandlerBase hb)Parse the content of the given {@link java.io.InputStream}
instance as XML using the specified {@link org.xml.sax.HandlerBase}.
Use of the DefaultHandler version of this method is recommended as
the HandlerBase class has been deprecated in SAX 2.0.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
this.parse(input, hb);
|
public void | parse(java.io.InputStream is, org.xml.sax.HandlerBase hb, java.lang.String systemId)Parse the content of the given {@link java.io.InputStream}
instance as XML using the specified {@link org.xml.sax.HandlerBase}.
Use of the DefaultHandler version of this method is recommended as
the HandlerBase class has been deprecated in SAX 2.0.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
input.setSystemId(systemId);
this.parse(input, hb);
|
public void | parse(java.io.InputStream is, org.xml.sax.helpers.DefaultHandler dh)Parse the content of the given {@link java.io.InputStream}
instance as XML using the specified
{@link org.xml.sax.helpers.DefaultHandler}.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
this.parse(input, dh);
|
public void | parse(java.io.InputStream is, org.xml.sax.helpers.DefaultHandler dh, java.lang.String systemId)Parse the content of the given {@link java.io.InputStream}
instance as XML using the specified
{@link org.xml.sax.helpers.DefaultHandler}.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
input.setSystemId(systemId);
this.parse(input, dh);
|
public void | parse(java.lang.String uri, org.xml.sax.HandlerBase hb)Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
{@link org.xml.sax.HandlerBase}.
Use of the DefaultHandler version of this method is recommended as
the HandlerBase class has been deprecated in SAX 2.0
if (uri == null) {
throw new IllegalArgumentException("uri cannot be null");
}
InputSource input = new InputSource(uri);
this.parse(input, hb);
|
public void | parse(java.lang.String uri, org.xml.sax.helpers.DefaultHandler dh)Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
{@link org.xml.sax.helpers.DefaultHandler}.
if (uri == null) {
throw new IllegalArgumentException("uri cannot be null");
}
InputSource input = new InputSource(uri);
this.parse(input, dh);
|
public void | parse(java.io.File f, org.xml.sax.HandlerBase hb)Parse the content of the file specified as XML using the
specified {@link org.xml.sax.HandlerBase}.
Use of the DefaultHandler version of this method is recommended as
the HandlerBase class has been deprecated in SAX 2.0
if (f == null) {
throw new IllegalArgumentException("File cannot be null");
}
//convert file to appropriate URI, f.toURI().toASCIIString()
//converts the URI to string as per rule specified in
//RFC 2396,
InputSource input = new InputSource(f.toURI().toASCIIString());
this.parse(input, hb);
|
public void | reset()Reset this SAXParser to its original configuration.
SAXParser is reset to the same state as when it was created with
{@link SAXParserFactory#newSAXParser()}.
reset() is designed to allow the reuse of existing SAXParser s
thus saving resources associated with the creation of new SAXParser s.
The reset SAXParser is not guaranteed to have the same {@link Schema}
Object , e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
Schema .
// implementors should override this method
throw new UnsupportedOperationException(
"This SAXParser, \"" + this.getClass().getName() + "\", does not support the reset functionality."
+ " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
+ " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
);
|
public abstract void | setProperty(java.lang.String name, java.lang.Object value)Sets the particular property in the underlying implementation of
{@link org.xml.sax.XMLReader}.
A list of the core features and properties can be found at
http://sax.sourceforge.net/?selected=get-set.
|