|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectorg.xml.sax.helpers.LocatorImpl
public class LocatorImpl
提供 Locator 的可選的有用實作。
此模組(包括源程式碼和文檔)位於公共域中,對該模組不提供擔保。有關更多資訊,請參閱http://www.saxproject.org。
此類別主要對應用程序編寫者有用,他們可以在文檔解析過程中使用該類別對任意點的定位器進行持久快照:
Locator locator;
Locator startloc;
public void setLocator (Locator locator)
{
// note the locator
this.locator = locator;
}
public void startDocument ()
{
// save the location of the start of the document
// for future use.
Locator startloc = new LocatorImpl(locator);
}
通常,解析器編寫者將不使用此類別,因為僅當請求時提供位置資訊才能更有效,而不持續地更新 Locator 物件。
Locator| 建構子摘要 | |
|---|---|
LocatorImpl()
零參數的建構子。 |
|
LocatorImpl(Locator locator)
複製建構子。 |
|
| 方法摘要 | |
|---|---|
int |
getColumnNumber()
返回保存的列數(從 1 開始)。 |
int |
getLineNumber()
返回保存的行數(從 1 開始)。 |
String |
getPublicId()
返回保存的公開標識符。 |
String |
getSystemId()
返回保存的系統標識符。 |
void |
setColumnNumber(int columnNumber)
設置此定位器的列數(從 1 開始)。 |
void |
setLineNumber(int lineNumber)
設置此定位器的行數(從 1 開始)。 |
void |
setPublicId(String publicId)
設置此定位器的公開標識符。 |
void |
setSystemId(String systemId)
設置此定位器的系統標識符。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public LocatorImpl()
這通常沒有用,因為此類別的主要用途是獲取現有 Locator 的快照。
public LocatorImpl(Locator locator)
創建定位器的當前狀態的持久副本。當初始定位器更改時,此副本將仍保持初始值(並且可以在 DocumentHandler 方法的作用域之外使用它)。
locator - 要複製的定位器。| 方法詳細資訊 |
|---|
public String getPublicId()
Locator 中的 getPublicIdLocator.getPublicId(),
setPublicId(java.lang.String)public String getSystemId()
Locator 中的 getSystemIdLocator.getSystemId(),
setSystemId(java.lang.String)public int getLineNumber()
Locator 中的 getLineNumberLocator.getLineNumber(),
setLineNumber(int)public int getColumnNumber()
Locator 中的 getColumnNumberLocator.getColumnNumber(),
setColumnNumber(int)public void setPublicId(String publicId)
publicId - 新的公開標識符,如果沒有可用的,則為 null。getPublicId()public void setSystemId(String systemId)
systemId - 新的系統標識符,如果沒有可用的,則為 null。getSystemId()public void setLineNumber(int lineNumber)
lineNumber - 行數,如果沒有可用的,則為 -1。getLineNumber()public void setColumnNumber(int columnNumber)
columnNumber - 列數,如果沒有可用的,則為 -1。getColumnNumber()
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。