uTools-Manuals/docs/java/org/xml/sax/helpers/XMLReaderFactory.html

170 lines
9.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
compact2, compact3
</div>
<div class="subTitle">
org.xml.sax.helpers
</div>
<h2 class="title" title="Class XMLReaderFactory">Class XMLReaderFactory</h2>
</div><div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.xml.sax.helpers.XMLReaderFactory</li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public final class <span class="typeNameLabel">XMLReaderFactory</span>
extends <a href="../../../../java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">
<span>用于创建XML阅读器的工厂。</span>
<blockquote>
<span><em>This module, both source code and documentation, is in the Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> See <a href="http://www.saxproject.org">http://www.saxproject.org</a> for further information.</span>
</blockquote>
<p> <span>此类包含从显式类名称或基于运行时默认值创建XML读取器的静态方法</span> </p>
<pre> <span>try {
XMLReader myReader = XMLReaderFactory.createXMLReader();
} catch (SAXException e) {
System.err.println(e.getMessage());
}</span> </pre>
<p> <span><strong>与解析器捆绑的分发注意事项:</strong>您应该修改无参数<em>createXMLReader的</em>实现,以处理未设置外部配置机制的情况。</span> <span>该方法应该尽可能地在类路径中返回一个解析器,即使没有将其类名称绑定到<code>org.xml.sax.driver</code> ,这样配置机制就可以看到它。</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
SAX 2.0
</dd>
<dt>
<span class="simpleTagLabel">Version:</span>
</dt>
<dd>
2.0.1sax2r2
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t1"><span><a href="javascript:show(1);">静态方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t4"><span><a href="javascript:show(8);">具体的方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>static <a href="../../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax">XMLReader</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/xml/sax/helpers/XMLReaderFactory.html#createXMLReader--">createXMLReader</a></span>()</code>
<div class="block">
尝试从系统默认值创建XMLReader。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>static <a href="../../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax">XMLReader</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/xml/sax/helpers/XMLReaderFactory.html#createXMLReader-java.lang.String-">createXMLReader</a></span>(<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> className)</code>
<div class="block">
尝试从类名创建XML阅读器。
</div> </td>
</tr>
</tbody>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- --> </a> <h3>Methods inherited from class java.lang.<a href="../../../../java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../../java/lang/Object.html#clone--">clone</a>, <a href="../../../../java/lang/Object.html#equals-java.lang.Object-">equals</a>, <a href="../../../../java/lang/Object.html#finalize--">finalize</a>, <a href="../../../../java/lang/Object.html#getClass--">getClass</a>, <a href="../../../../java/lang/Object.html#hashCode--">hashCode</a>, <a href="../../../../java/lang/Object.html#notify--">notify</a>, <a href="../../../../java/lang/Object.html#notifyAll--">notifyAll</a>, <a href="../../../../java/lang/Object.html#toString--">toString</a>, <a href="../../../../java/lang/Object.html#wait--">wait</a>, <a href="../../../../java/lang/Object.html#wait-long-">wait</a>, <a href="../../../../java/lang/Object.html#wait-long-int-">wait</a></code></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="createXMLReader--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>createXMLReader</h4> <pre>public static <a href="../../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax">XMLReader</a> createXMLReader()
throws <a href="../../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</a></pre>
<div class="block">
<span>尝试从系统默认值创建XMLReader。</span>
<span>在可以支持它的环境中XMLReader类的名称通过按顺序尝试这些选项来确定并使用成功的第一个选项</span>
<p></p>
<ul>
<li> <span>如果系统属性<code>org.xml.sax.driver</code>具有值则用作XMLReader类名。</span> </li>
<li> <span>JAR“服务API”用于在运行时可用的jarfile中的<em>META-INF / services / org.xml.sax.driver</em>文件中查找类名。</span> </li>
<li> <span>强烈地鼓励SAX解析器分发提供一个默认的XMLReader类名只有当前一个选项在此列表中不成功时才会生效。</span> </li>
<li> <span>最后,如果<a href="../../../../org/xml/sax/helpers/ParserFactory.html#makeParser--"><code>ParserFactory.makeParser()</code></a>可以返回一个系统默认的SAX1解析器那个解析器被包裹在一个<a href="../../../../org/xml/sax/helpers/ParserAdapter.html" title="org.xml.sax.helpers中的类"><code>ParserAdapter</code></a></span> <span>这是SAX1环境的迁移帮助其中<code>org.xml.sax.parser</code>系统属性通常可以使用。)</span> </li>
</ul>
<p> <span>在诸如不能支持灵活性的小型嵌入式系统的环境中,可以使用其他确定默认的机制。</span> </p>
<p> <span>请注意许多Java环境允许在命令行上初始化系统属性。</span> <span>这意味着<em>在大多数情况下</em>为该属性设置好的值可确保对此方法的调用将成功,除非安全策略介入。</span> <span>这也将最大限度地提高应用程序对旧版SAX环境的可移植性同时这种方法的实现也较少。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个新的XMLReader。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</a></code> - 如果不能识别和实例化默认的XMLReader类。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../../org/xml/sax/helpers/XMLReaderFactory.html#createXMLReader-java.lang.String-"><code>createXMLReader(java.lang.String)</code></a>
</dd>
</dl> </li>
</ul> <a name="createXMLReader-java.lang.String-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>createXMLReader</h4> <pre>public static <a href="../../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax">XMLReader</a> createXMLReader(<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> className)
throws <a href="../../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</a></pre>
<div class="block">
<span>尝试从类名创建XML阅读器。</span>
<p> <span>给定一个类名称该方法尝试加载和实例化该类作为XML读取器。</span> </p>
<p> <span>请注意,这种方法在不允许调用者(可能是小程序)不允许动态加载类的环境中不可用。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个新的XML阅读器。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</a></code> - 如果类无法加载实例化并转换为XMLReader。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../../org/xml/sax/helpers/XMLReaderFactory.html#createXMLReader--"><code>createXMLReader()</code></a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>