211 lines
9.4 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
</div>
<h2 class="title" title="Interface Locator">Interface Locator</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Known Subinterfaces:
</dt>
<dd>
<span><a href="../../../org/xml/sax/ext/Locator2.html" title="org.xml.sax.ext中的接口">Locator2</a></span>
</dd>
</dl>
<dl>
<dt>
所有已知实现类:
</dt>
<dd>
<span><a href="../../../org/xml/sax/ext/Locator2Impl.html" title="org.xml.sax.ext中的类">Locator2Impl</a> <a href="../../../org/xml/sax/helpers/LocatorImpl.html" title="org.xml.sax.helpers中的类">LocatorImpl</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">Locator</span></pre>
<div class="block">
<span>用于将SAX事件与文档位置相关联的界面。</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>如果SAX解析器向SAX应用程序提供位置信息则通过实现此接口然后使用内容处理程序的<a href="../../../org/xml/sax/ContentHandler.html#setDocumentLocator-org.xml.sax.Locator-"><code>setDocumentLocator</code></a>方法将实例传递给应用程序。</span> <span>应用程序可以使用该对象来获取XML源文档中任何其他SAX事件的位置。</span> </p>
<p> <span>请注意,对象返回的结果将仅在每个回调方法的范围内有效:如果尝试在任何其他时间使用定位器,或解析完成后,应用程序将收到不可预测的结果。</span> </p>
<p> <span>SAX解析器不需要提供定位器但是非常鼓励它们这样做。</span> <span>如果解析器提供定位器,则在报告任何其他文档事件之前必须这样做。</span> <span>如果应用程序收到<a href="../../../org/xml/sax/ContentHandler.html#startDocument--"><code>startDocument</code></a>事件时没有设置定位器,应用程序应该假定定位器不可用。</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
SAX 1.0
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../org/xml/sax/ContentHandler.html#setDocumentLocator-org.xml.sax.Locator-"><code>ContentHandler.setDocumentLocator(org.xml.sax.Locator)</code></a>
</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="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</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>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/xml/sax/Locator.html#getColumnNumber--">getColumnNumber</a></span>()</code>
<div class="block">
返回当前文档事件结束的列号。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/xml/sax/Locator.html#getLineNumber--">getLineNumber</a></span>()</code>
<div class="block">
返回当前文档事件结束的行号。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="../../../java/lang/String.html" title="class in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/xml/sax/Locator.html#getPublicId--">getPublicId</a></span>()</code>
<div class="block">
返回当前文档事件的公共标识符。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><a href="../../../java/lang/String.html" title="class in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/xml/sax/Locator.html#getSystemId--">getSystemId</a></span>()</code>
<div class="block">
返回当前文档事件的系统标识符。
</div> </td>
</tr>
</tbody>
</table> </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="getPublicId--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getPublicId</h4> <pre><a href="../../../java/lang/String.html" title="class in java.lang">String</a> getPublicId()</pre>
<div class="block">
<span>返回当前文档事件的公共标识符。</span>
<p> <span>返回值是文档实体或外部解析实体的公开标识符,其中触发事件的标记出现。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
包含公共标识符的字符串如果没有可用则为null。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../org/xml/sax/Locator.html#getSystemId--"><code>getSystemId()</code></a>
</dd>
</dl> </li>
</ul> <a name="getSystemId--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSystemId</h4> <pre><a href="../../../java/lang/String.html" title="class in java.lang">String</a> getSystemId()</pre>
<div class="block">
<span>返回当前文档事件的系统标识符。</span>
<p> <span>返回值是文档实体或外部解析实体的系统标识符,其中触发事件的标记出现。</span> </p>
<p> <span>如果系统标识符是URL解析器必须在将其传递给应用程序之前将其完全解析。</span> <span>例如,文件名必须始终作为<em>文件</em>提供<em>...</em> URL而其他类型的相对URI也会根据其基础进行解析。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
包含系统标识符的字符串,如果没有可用,则为空。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../org/xml/sax/Locator.html#getPublicId--"><code>getPublicId()</code></a>
</dd>
</dl> </li>
</ul> <a name="getLineNumber--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getLineNumber</h4> <pre>int getLineNumber()</pre>
<div class="block">
<span>返回当前文档事件结束的行号。</span>
<span>行由行尾界定在XML规范中定义。</span>
<p> <span><strong>警告:方法</strong>的返回值仅作为诊断用途的近似值;</span> <span>它不是提供足够的信息来编辑原始XML文档的字符内容。</span> <span>在某些情况下,这些“行”数字与列显示的数字相匹配,而在其他情况下,由于内部实体扩展,它们可能与源文本不匹配。</span> </p>
<p> <span>返回值是文档实体或外部解析实体中触发事件的标记出现的行号的近似值。</span> </p>
<p> <span>如果可能SAX驱动程序应该在与文档事件相关联的文本之后提供第一个字符的行位置。</span> <span>第一行是第1行。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
行号,如果没有可用,则为-1。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../org/xml/sax/Locator.html#getColumnNumber--"><code>getColumnNumber()</code></a>
</dd>
</dl> </li>
</ul> <a name="getColumnNumber--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>getColumnNumber</h4> <pre>int getColumnNumber()</pre>
<div class="block">
<span>返回当前文档事件结束的列号。</span>
<span>自从最后一行结束以来这是一个基于Java <code>char</code>一个数字。</span>
<p> <span><strong>警告:方法</strong>的返回值仅作为诊断用途的近似值;</span> <span>它不是提供足够的信息来编辑原始XML文档的字符内容。</span> <span>例如,当行包含组合字符序列,宽字符,代理对或双向文本时,该值可能不对应于文本编辑器的显示中的列。</span> </p>
<p> <span>返回值是文档实体或外部解析实体中触发事件的标记出现的列号的近似值。</span> </p>
<p> <span>如果可能SAX驱动程序应该在与文档事件相关联的文本之后提供第一个字符的行位置。</span> <span>每行的第一列是第1列。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
列号,如果没有可用,则为-1。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../org/xml/sax/Locator.html#getLineNumber--"><code>getLineNumber()</code></a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>