java.lang.Object
org.xml.sax.helpers.LocatorImpl
- すべての実装されたインタフェース:
Locator
- 直系の既知のサブクラス:
Locator2Impl
オプションとしてLocatorの簡易実装を提供します。
このクラスは、主としてアプリケーション作成者を対象としています。アプリケーション作成者は、このクラスを使って、下記のように文書の構文解析中にロケータの永続的なスナップショットを作成できます。
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オブジェクトを更新するよりも、位置情報を要求されたときにだけ提供するほうが効率的だからです。
- 導入されたバージョン:
- 1.4, SAX 1.0
- 関連項目:
-
コンストラクタのサマリー
-
メソッドのサマリー
修飾子と型メソッド説明int
保存されている列番号を返します(開始番号は1)。int
保存されている行番号を返します(開始番号は1)。保存されている公開識別子を返します。保存されているシステム識別子を返します。void
setColumnNumber
(int columnNumber) このロケータの列番号を設定します(開始番号は1)。void
setLineNumber
(int lineNumber) このロケータの行番号を設定します(開始番号は1)。void
setPublicId
(String publicId) このロケータの公開識別子を設定します。void
setSystemId
(String systemId) このロケータのシステム識別子を設定します。
-
コンストラクタの詳細
-
LocatorImpl
public LocatorImpl()デフォルトの引数なしのコンストラクタです。このクラスの主目的は、既存のLocatorのスナップショットを作成することなので、通常あまり実用的ではありません。
-
LocatorImpl
public LocatorImpl(Locator locator) コピー・コンストラクタです。ロケータの現在の状態の永続的なコピーを作成します。 元のロケータが変更されても、コピーには元の値が保存されています。このコピーは、DocumentHandlerメソッドのスコープ外でも使用可能です。
- パラメータ:
locator
- コピー対象のロケータ。
-
-
メソッドの詳細
-
getPublicId
public String getPublicId()保存されている公開識別子を返します。- 定義:
getPublicId
、インタフェースLocator
- 戻り値:
- 公開識別子を示す文字列。使用できない場合はnull。
- 関連項目:
-
getSystemId
public String getSystemId()保存されているシステム識別子を返します。- 定義:
getSystemId
、インタフェースLocator
- 戻り値:
- システム識別子を示す文字列。使用できない場合はnull。
- 関連項目:
-
getLineNumber
public int getLineNumber()保存されている行番号を返します(開始番号は1)。- 定義:
getLineNumber
、インタフェースLocator
- 戻り値:
- 行番号を示す整数。使用できない場合は -1。
- 関連項目:
-
getColumnNumber
public int getColumnNumber()保存されている列番号を返します(開始番号は1)。- 定義:
getColumnNumber
、インタフェースLocator
- 戻り値:
- 列番号を示す整数。使用できない場合は -1。
- 関連項目:
-
setPublicId
public void setPublicId(String publicId) このロケータの公開識別子を設定します。- パラメータ:
publicId
- 新しい公開識別子。使用できない場合はnull。- 関連項目:
-
setSystemId
public void setSystemId(String systemId) このロケータのシステム識別子を設定します。- パラメータ:
systemId
- 新しいシステム識別子。使用できない場合はnull。- 関連項目:
-
setLineNumber
public void setLineNumber(int lineNumber) このロケータの行番号を設定します(開始番号は1)。- パラメータ:
lineNumber
- 行番号。使用できない場合は -1。- 関連項目:
-
setColumnNumber
public void setColumnNumber(int columnNumber) このロケータの列番号を設定します(開始番号は1)。- パラメータ:
columnNumber
- 列番号。使用できない場合は -1。- 関連項目:
-