Class org.xml.sax.helpers.LocatorImpl

java.lang.Object
   |
   +—org.xml.sax.helpers.LocatorImpl

public class LocatorImpl

extends Object

implements Locator —Provides an optional convenience implementation of Locator.

This class is available mainly for application writers, who can use it to make a persistent snapshot of a locator at any point during a document parse:

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);
}

Normally, parser writers will not use this class, since it is more efficient to provide location information only ...

Get Enterprise Application Integration With XML and Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.