Class 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
    • 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 interface Stringable
        Returns:
        The string representation.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable