Package org.glassfish.json
Class JsonLocationImpl
- java.lang.Object
-
- org.glassfish.json.JsonLocationImpl
-
- All Implemented Interfaces:
JsonLocation
class JsonLocationImpl extends java.lang.Object implements JsonLocation
-
-
Field Summary
Fields Modifier and Type Field Description private longcolumnNoprivate longlineNoprivate longoffset(package private) static JsonLocationUNKNOWN
-
Constructor Summary
Constructors Constructor Description JsonLocationImpl(long lineNo, long columnNo, long streamOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetColumnNumber()Return the column number (starts with 1 for the first column) for the current JSON event in the input source.longgetLineNumber()Return the line number (starts with 1 for the first line) for the current JSON event in the input source.longgetStreamOffset()Return the stream offset into the input source this location is pointing to.java.lang.StringtoString()
-
-
-
Field Detail
-
UNKNOWN
static final JsonLocation UNKNOWN
-
columnNo
private final long columnNo
-
lineNo
private final long lineNo
-
offset
private final long offset
-
-
Method Detail
-
getLineNumber
public long getLineNumber()
Description copied from interface:JsonLocationReturn the line number (starts with 1 for the first line) for the current JSON event in the input source.- Specified by:
getLineNumberin interfaceJsonLocation- Returns:
- the line number (starts with 1 for the first line) or -1 if none is available
-
getColumnNumber
public long getColumnNumber()
Description copied from interface:JsonLocationReturn the column number (starts with 1 for the first column) for the current JSON event in the input source.- Specified by:
getColumnNumberin interfaceJsonLocation- Returns:
- the column number (starts with 1 for the first column) or -1 if none is available
-
getStreamOffset
public long getStreamOffset()
Description copied from interface:JsonLocationReturn the stream offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.- Specified by:
getStreamOffsetin interfaceJsonLocation- Returns:
- the offset of input source stream, or -1 if there is no offset available
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-