Package org.codehaus.jackson
Class JsonLocation
java.lang.Object
org.codehaus.jackson.JsonLocation
- All Implemented Interfaces:
Serializable
Object that encapsulates Location information used for reporting
parsing (or potentially generation) errors, as well as current location
within input streams.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonLocation
Shared immutable "N/A location" that can be returned to indicate that no location information is available -
Constructor Summary
ConstructorsConstructorDescriptionJsonLocation
(Object srcRef, long totalChars, int lineNr, int colNr) JsonLocation
(Object sourceRef, long totalBytes, long totalChars, int lineNr, int columnNr) -
Method Summary
-
Field Details
-
NA
Shared immutable "N/A location" that can be returned to indicate that no location information is available- Since:
- 1.3
-
-
Constructor Details
-
JsonLocation
-
JsonLocation
-
-
Method Details
-
getSourceRef
Reference to the original resource being read, if one available. For example, when a parser has been constructed by passing aFile
instance, this method would return that File. Will return null if no such reference is available, for example whenInputStream
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
-
hashCode
public int hashCode() -
equals
-