org.zkoss.json.parser
Class ParseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.zkoss.json.parser.ParseException
All Implemented Interfaces:
java.io.Serializable

public class ParseException
extends java.lang.RuntimeException

ParseException explains why and where the error occurs in source JSON text.

Author:
FangYidong
See Also:
Serialized Form

Field Summary
static int ERROR_UNEXPECTED_CHAR
           
static int ERROR_UNEXPECTED_EXCEPTION
           
static int ERROR_UNEXPECTED_TOKEN
           
 
Constructor Summary
ParseException(int errorType)
           
ParseException(int position, int errorType, java.lang.Object unexpectedObject)
           
ParseException(int errorType, java.lang.Object unexpectedObject)
           
 
Method Summary
 int getErrorType()
           
 int getPosition()
           
 java.lang.Object getUnexpectedObject()
           
 void setErrorType(int errorType)
           
 void setPosition(int position)
           
 void setUnexpectedObject(java.lang.Object unexpectedObject)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_UNEXPECTED_CHAR

public static final int ERROR_UNEXPECTED_CHAR
See Also:
Constant Field Values

ERROR_UNEXPECTED_TOKEN

public static final int ERROR_UNEXPECTED_TOKEN
See Also:
Constant Field Values

ERROR_UNEXPECTED_EXCEPTION

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

ParseException

public ParseException(int errorType)

ParseException

public ParseException(int errorType,
                      java.lang.Object unexpectedObject)

ParseException

public ParseException(int position,
                      int errorType,
                      java.lang.Object unexpectedObject)
Method Detail

getErrorType

public int getErrorType()

setErrorType

public void setErrorType(int errorType)

getPosition

public int getPosition()
Returns:
The character position (starting with 0) of the input where the error occurs.
See Also:
JSONParser.getPosition()

setPosition

public void setPosition(int position)

getUnexpectedObject

public java.lang.Object getUnexpectedObject()
Returns:
One of the following base on the value of errorType: ERROR_UNEXPECTED_CHAR java.lang.Character ERROR_UNEXPECTED_TOKEN org.zkoss.json.parser.Yytoken ERROR_UNEXPECTED_EXCEPTION java.lang.Exception
See Also:
Yytoken

setUnexpectedObject

public void setUnexpectedObject(java.lang.Object unexpectedObject)

toString

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


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo