モジュール java.xml
パッケージ org.xml.sax.helpers

クラスLocatorImpl

java.lang.Object
org.xml.sax.helpers.LocatorImpl
すべての実装されたインタフェース:
Locator
直系の既知のサブクラス:
Locator2Impl

public class LocatorImpl extends Object implements Locator
オプションとして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
関連項目: