com.fasterxml.jackson.core

## Class JsonLocation

- java.lang.Object
- - com.fasterxml.jackson.core.JsonLocation

All Implemented Interfaces:
  Serializable

    public class JsonLocation
    extends Object
    implements Serializable

Object that encapsulates Location information used for reporting parsing (or potentially generation) errors, as well as current location within input streams.

See Also:
  Serialized Form

### Field Summary

Fields
`static JsonLocation` `NA` Shared immutable "N/A location" that can be returned to indicate that no location information is available

### Constructor Summary

Constructors
Constructor and Description
`JsonLocation(Object srcRef, long totalChars, int lineNr, int colNr)`
`JsonLocation(Object sourceRef, long totalBytes, long totalChars, int lineNr, int columnNr)`

### Method Summary

Methods
`boolean` `equals(Object other)`
`long` `getByteOffset()`
`long` `getCharOffset()`
`int` `getColumnNr()`
`int` `getLineNr()`
`Object` `getSourceRef()` Reference to the original resource being read, if one available.
`int` `hashCode()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### NA

    public static final JsonLocation NA

Shared immutable "N/A location" that can be returned to indicate that no location information is available

### Constructor Detail

#### JsonLocation

    public JsonLocation(Object srcRef,
                long totalChars,
                int lineNr,
                int colNr)

#### JsonLocation

    public JsonLocation(Object sourceRef,
                long totalBytes,
                long totalChars,
                int lineNr,
                int columnNr)

### Method Detail

#### getSourceRef

    public Object getSourceRef()

Reference to the original resource being read, if one available. For example, when a parser has been constructed by passing a `File` instance, this method would return that File. Will return null if no such reference is available, for example when `InputStream` was used to construct the parser instance.

#### getLineNr

    public int getLineNr()

Returns:
  Line number of the location (1-based)

#### getColumnNr

    public int getColumnNr()

Returns:
  Column number of the location (1-based)

#### getCharOffset

    public long getCharOffset()

Returns:
  Character offset within underlying stream, reader or writer, if available; -1 if not.

#### getByteOffset

    public long getByteOffset()

Returns:
  Byte offset within underlying stream, reader or writer, if available; -1 if not.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object other)

Overrides:
  `equals` in class `Object`