Package net.morimekta.util.json
Class JsonException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- net.morimekta.util.json.JsonException
-
- All Implemented Interfaces:
java.io.Serializable
,Displayable
,Stringable
public class JsonException extends java.lang.Exception implements Stringable, Displayable
Exception in parsing JSON.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JsonException(java.lang.String message, java.lang.String line, int lineNo, int linePos, int len)
JsonException(java.lang.String message, JsonTokenizer tokenizer, JsonToken token)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
asString()
Deprecated.java.lang.String
displayString()
int
getLen()
java.lang.String
getLine()
int
getLineNo()
int
getLinePos()
Get the line position, 1-indexed of the first character that is part of the exception.java.lang.String
toString()
-
-
-
Constructor Detail
-
JsonException
public JsonException(java.lang.String message, java.lang.String line, int lineNo, int linePos, int len)
-
JsonException
public JsonException(java.lang.String message, JsonTokenizer tokenizer, JsonToken token) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getLine
public java.lang.String getLine()
- Returns:
- The full utf-8 line (no ending line break) of the exception.
-
getLineNo
public int getLineNo()
- Returns:
- The 1-indexed line number of the exception. If not representing a token, will be 0.
-
getLinePos
public int getLinePos()
Get the line position, 1-indexed of the first character that is part of the exception. If not representing a token, will be 0.- Returns:
- Line position.
-
getLen
public int getLen()
- Returns:
- The number of chars representing the token causing the exception. Will be at least 1 for anything representing a token. If not representing a token, will be 0.
-
asString
@Deprecated public java.lang.String asString()
Deprecated.Description copied from interface:Stringable
Make a string representation of the instance value.- Specified by:
asString
in interfaceStringable
- Returns:
- The string representation.
-
displayString
@Nonnull public java.lang.String displayString()
- Specified by:
displayString
in interfaceDisplayable
- Returns:
- A displayable string value for the object. This is meant to be printed e.g. to console output and interpreted by a human.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
-