public class

JsonLocation

extends Object
implements Serializable
java.lang.Object
   ↳ com.fasterxml.jackson.core.JsonLocation

Class Overview

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

Summary

Fields
public static final JsonLocation NA Shared immutable "N/A location" that can be returned to indicate that no location information is available
Public Constructors
JsonLocation(Object srcRef, long totalChars, int lineNr, int colNr)
JsonLocation(Object sourceRef, long totalBytes, long totalChars, int lineNr, int columnNr)
Public 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()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final JsonLocation NA

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

Public Constructors

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

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

Public Methods

public boolean equals (Object other)

public long getByteOffset ()

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

public long getCharOffset ()

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

public int getColumnNr ()

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

public int getLineNr ()

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

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.

public int hashCode ()

public String toString ()