net.arnx.jsonic
Class JSONException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.arnx.jsonic.JSONException
All Implemented Interfaces:
Serializable

public class JSONException
extends RuntimeException

Signals that an error has been reached unexpectedly while formating or parsing.

Summary of error codes

code(range) error code description
000-099(all)reserved.
100-199100fails to format.
150fails to preformat.
(others)reserved.
200-299200fails to parse.
250fails to postparse.
(others)reserved.
300-899(all)reserved.
900-(all)user's area.

Author:
izuno
See Also:
Serialized Form

Field Summary
static int FORMAT_ERROR
           
static int PARSE_ERROR
           
static int POSTPARSE_ERROR
           
static int PREFORMAT_ERROR
           
 
Constructor Summary
JSONException(String message, int id)
           
JSONException(String message, int id, long lineNumber, long columnNumber, long offset)
           
JSONException(String message, int id, Throwable cause)
           
 
Method Summary
 long getColumnNumber()
          Returns the column number where the error was found.
 int getErrorCode()
           
 long getErrorOffset()
          Returns the offset in line where the error was found.
 long getLineNumber()
          Returns the line number where the error was found.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FORMAT_ERROR

public static final int FORMAT_ERROR
See Also:
Constant Field Values

PREFORMAT_ERROR

public static final int PREFORMAT_ERROR
See Also:
Constant Field Values

PARSE_ERROR

public static final int PARSE_ERROR
See Also:
Constant Field Values

POSTPARSE_ERROR

public static final int POSTPARSE_ERROR
See Also:
Constant Field Values
Constructor Detail

JSONException

public JSONException(String message,
                     int id,
                     long lineNumber,
                     long columnNumber,
                     long offset)

JSONException

public JSONException(String message,
                     int id,
                     Throwable cause)

JSONException

public JSONException(String message,
                     int id)
Method Detail

getErrorCode

public int getErrorCode()

getLineNumber

public long getLineNumber()
Returns the line number where the error was found.


getColumnNumber

public long getColumnNumber()
Returns the column number where the error was found.


getErrorOffset

public long getErrorOffset()
Returns the offset in line where the error was found.