📄 xmlreader.html
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/xml/sax/XMLReader.html#setErrorHandler(org.xml.sax.ErrorHandler)">setErrorHandler</A></B>(<A HREF="../../../org/xml/sax/ErrorHandler.html">ErrorHandler</A> handler)</CODE>
<BR>
Allow an application to register an error event handler.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/xml/sax/XMLReader.html#setFeature(java.lang.String, boolean)">setFeature</A></B>(java.lang.String name,
boolean value)</CODE>
<BR>
Set the state of a feature.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/xml/sax/XMLReader.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A></B>(java.lang.String name,
java.lang.Object value)</CODE>
<BR>
Set the value of a property.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getFeature(java.lang.String)"><!-- --></A><H3>
getFeature</H3>
<PRE>
public boolean <B>getFeature</B>(java.lang.String name)
throws <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A>,
<A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></PRE>
<DL>
<DD>Look up the value of a feature.
<p>The feature name is any fully-qualified URI. It is
possible for an XMLReader to recognize a feature name but
to be unable to return its value; this is especially true
in the case of an adapter for a SAX1 Parser, which has
no way of knowing whether the underlying parser is
performing validation or expanding external entities.</p>
<p>All XMLReaders are required to recognize the
http://xml.org/sax/features/namespaces and the
http://xml.org/sax/features/namespace-prefixes feature names.</p>
<p>Some feature values may be available only in specific
contexts, such as before, during, or after a parse.</p>
<p>Typical usage is something like this:</p>
<pre>
XMLReader r = new MySAXDriver();
// try to activate validation
try {
r.setFeature("http://xml.org/sax/features/validation", true);
} catch (SAXException e) {
System.err.println("Cannot activate validation.");
}
// register event handlers
r.setContentHandler(new MyContentHandler());
r.setErrorHandler(new MyErrorHandler());
// parse the first document
try {
r.parse("http://www.foo.com/mydoc.xml");
} catch (IOException e) {
System.err.println("I/O exception reading XML document");
} catch (SAXException e) {
System.err.println("XML exception reading document.");
}
</pre>
<p>Implementors are free (and encouraged) to invent their own features,
using names built on their own URIs.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The feature name, which is a fully-qualified URI.<DT><B>Returns:</B><DD>The current state of the feature (true or false).<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A></CODE> - When the
XMLReader does not recognize the feature name.<DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></CODE> - When the
XMLReader recognizes the feature name but
cannot determine its value at this time.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/XMLReader.html#setFeature(java.lang.String, boolean)"><CODE>setFeature(java.lang.String, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setFeature(java.lang.String, boolean)"><!-- --></A><H3>
setFeature</H3>
<PRE>
public void <B>setFeature</B>(java.lang.String name,
boolean value)
throws <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A>,
<A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></PRE>
<DL>
<DD>Set the state of a feature.
<p>The feature name is any fully-qualified URI. It is
possible for an XMLReader to recognize a feature name but
to be unable to set its value; this is especially true
in the case of an adapter for a SAX1 <A HREF="../../../org/xml/sax/Parser.html"><CODE>Parser</CODE></A>,
which has no way of affecting whether the underlying parser is
validating, for example.</p>
<p>All XMLReaders are required to support setting
http://xml.org/sax/features/namespaces to true and
http://xml.org/sax/features/namespace-prefixes to false.</p>
<p>Some feature values may be immutable or mutable only
in specific contexts, such as before, during, or after
a parse.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The feature name, which is a fully-qualified URI.<DD><CODE>state</CODE> - The requested state of the feature (true or false).<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A></CODE> - When the
XMLReader does not recognize the feature name.<DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></CODE> - When the
XMLReader recognizes the feature name but
cannot set the requested value.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/XMLReader.html#getFeature(java.lang.String)"><CODE>getFeature(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getProperty(java.lang.String)"><!-- --></A><H3>
getProperty</H3>
<PRE>
public java.lang.Object <B>getProperty</B>(java.lang.String name)
throws <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A>,
<A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></PRE>
<DL>
<DD>Look up the value of a property.
<p>The property name is any fully-qualified URI. It is
possible for an XMLReader to recognize a property name but
to be unable to return its state; this is especially true
in the case of an adapter for a SAX1 <A HREF="../../../org/xml/sax/Parser.html"><CODE>Parser</CODE></A>.</p>
<p>XMLReaders are not required to recognize any specific
property names, though an initial core set is documented for
SAX2.</p>
<p>Some property values may be available only in specific
contexts, such as before, during, or after a parse.</p>
<p>Implementors are free (and encouraged) to invent their own properties,
using names built on their own URIs.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The property name, which is a fully-qualified URI.<DT><B>Returns:</B><DD>The current value of the property.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A></CODE> - When the
XMLReader does not recognize the property name.<DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></CODE> - When the
XMLReader recognizes the property name but
cannot determine its value at this time.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/XMLReader.html#setProperty(java.lang.String, java.lang.Object)"><CODE>setProperty(java.lang.String, java.lang.Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setProperty(java.lang.String, java.lang.Object)"><!-- --></A><H3>
setProperty</H3>
<PRE>
public void <B>setProperty</B>(java.lang.String name,
java.lang.Object value)
throws <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A>,
<A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></PRE>
<DL>
<DD>Set the value of a property.
<p>The property name is any fully-qualified URI. It is
possible for an XMLReader to recognize a property name but
to be unable to set its value; this is especially true
in the case of an adapter for a SAX1 <A HREF="../../../org/xml/sax/Parser.html"><CODE>Parser</CODE></A>.</p>
<p>XMLReaders are not required to recognize setting
any specific property names, though a core set is provided with
SAX2.</p>
<p>Some property values may be immutable or mutable only
in specific contexts, such as before, during, or after
a parse.</p>
<p>This method is also the standard mechanism for setting
extended handlers.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The property name, which is a fully-qualified URI.<DD><CODE>state</CODE> - The requested value for the property.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html">SAXNotRecognizedException</A></CODE> - When the
XMLReader does not recognize the property name.<DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html">SAXNotSupportedException</A></CODE> - When the
XMLReader recognizes the property name but
cannot set the requested value.</DL>
</DD>
</DL>
<HR>
<A NAME="setEntityResolver(org.xml.sax.EntityResolver)"><!-- --></A><H3>
setEntityResolver</H3>
<PRE>
public void <B>setEntityResolver</B>(<A HREF="../../../org/xml/sax/EntityResolver.html">EntityResolver</A> resolver)</PRE>
<DL>
<DD>Allow an application to register an entity resolver.
<p>If the application does not register an entity resolver,
the XMLReader will perform its own default resolution.</p>
<p>Applications may register a new or different resolver in the
middle of a parse, and the SAX parser must begin using the new
resolver immediately.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>resolver</CODE> - The entity resolver.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - If the resolver
argument is null.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/XMLReader.html#getEntityResolver()"><CODE>getEntityResolver()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getEntityResolver()"><!-- --></A><H3>
getEntityResolver</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -