# LocatorImpl

public class **LocatorImpl** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html)

|---|---|---|
| Known Direct Subclasses [Locator2Impl](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ext/Locator2Impl.html) |---|---| | [Locator2Impl](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ext/Locator2Impl.html) | SAX2 extension helper for holding additional Entity information, implementing the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ext/Locator2.html` interface. | |||

Provide an optional convenience implementation of Locator.

> *This module, both source code and documentation, is in the
> Public Domain, and comes with **NO WARRANTY**.* See <http://www.saxproject.org> for further information.

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 when
requested, rather than constantly updating a Locator object.

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html`

### Public Constructor Summary

|---|---|
|   | [LocatorImpl](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#LocatorImpl())() Zero-argument constructor. |
|   | [LocatorImpl](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#LocatorImpl(org.xml.sax.Locator))([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator) Copy constructor. |

### Public Method Summary

|---|---|
| int | [getColumnNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getColumnNumber())() Return the saved column number (1-based). |
| int | [getLineNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getLineNumber())() Return the saved line number (1-based). |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getPublicId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getPublicId())() Return the saved public identifier. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getSystemId())() Return the saved system identifier. |
| void | [setColumnNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setColumnNumber(int))(int columnNumber) Set the column number for this locator (1-based). |
| void | [setLineNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setLineNumber(int))(int lineNumber) Set the line number for this locator (1-based). |
| void | [setPublicId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setPublicId(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId) Set the public identifier for this locator. |
| void | [setSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setSystemId(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId) Set the system identifier for this locator. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [org.xml.sax.Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html)

|---|---|
| abstract int | [getColumnNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getColumnNumber())() Return the column number where the current document event ends. |
| abstract int | [getLineNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getLineNumber())() Return the line number where the current document event ends. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getPublicId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getPublicId())() Return the public identifier for the current document event. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getSystemId())() Return the system identifier for the current document event. |

## Public Constructors

#### public
**LocatorImpl**
()

Zero-argument constructor.

This will not normally be useful, since the main purpose
of this class is to make a snapshot of an existing Locator.

<br />

#### public
**LocatorImpl**
([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator)

Copy constructor.

Create a persistent copy of the current state of a locator.
When the original locator changes, this copy will still keep
the original values (and it can be used outside the scope of
DocumentHandler methods).

<br />

##### Parameters

| locator | The locator to copy. |
|---|---|

## Public Methods

#### public int
**getColumnNumber**
()

Return the saved column number (1-based).

##### Returns

- The column number as an integer, or -1 if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getColumnNumber()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setColumnNumber(int)`

#### public int
**getLineNumber**
()

Return the saved line number (1-based).

##### Returns

- The line number as an integer, or -1 if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getLineNumber()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setLineNumber(int)`

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getPublicId**
()

Return the saved public identifier.

##### Returns

- The public identifier as a string, or null if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getPublicId()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setPublicId(java.lang.String)`

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getSystemId**
()

Return the saved system identifier.

##### Returns

- The system identifier as a string, or null if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getSystemId()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#setSystemId(java.lang.String)`

#### public void
**setColumnNumber**
(int columnNumber)

Set the column number for this locator (1-based).

##### Parameters

| columnNumber | The column number, or -1 if none is available. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getColumnNumber()`

#### public void
**setLineNumber**
(int lineNumber)

Set the line number for this locator (1-based).

##### Parameters

| lineNumber | The line number, or -1 if none is available. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getLineNumber()`

#### public void
**setPublicId**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId)

Set the public identifier for this locator.

##### Parameters

| publicId | The new public identifier, or null if none is available. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getPublicId()`

#### public void
**setSystemId**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId)

Set the system identifier for this locator.

##### Parameters

| systemId | The new system identifier, or null if none is available. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/LocatorImpl.html#getSystemId()`