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
,Stringable
public class JsonException extends java.lang.Exception implements Stringable
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 Modifier and Type Method Description java.lang.String
asString()
Make a string representation of the instance value.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
public java.lang.String asString()
Description copied from interface:Stringable
Make a string representation of the instance value.- Specified by:
asString
in interfaceStringable
- Returns:
- The string representation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
-