Package JsonFse
Class ParseErrorEx
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- JsonFse.ParseErrorEx
-
- All Implemented Interfaces:
java.io.Serializable
public class ParseErrorEx extends java.lang.Exception
This exception is thrown when the JSON parser detects a parse error. The error position and the cause of the error can be seen by calling the methods getErrStr(), getErrPos() and getErrMsg().- Author:
- Friedemann Seebass
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description ParseErrorEx()
Creates an empty ParseError exception.protected
ParseErrorEx(java.lang.String jsonStr, int pos, java.lang.String errStr)
Creates a ParseError exception and sets the members for showing the error position and the cause of the error.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getErrMsg()
Returns a multi line error message string with the original string to parse in the first line and a pointer where the error was detected in the second line and the error in the last line.int
getErrPos()
Returns the error position in the JSON object.java.lang.String
getErrStr()
Returns the error message.
-
-
-
Constructor Detail
-
ParseErrorEx
public ParseErrorEx()
Creates an empty ParseError exception.
-
ParseErrorEx
protected ParseErrorEx(java.lang.String jsonStr, int pos, java.lang.String errStr)
Creates a ParseError exception and sets the members for showing the error position and the cause of the error.- Parameters:
jsonStr
- The original string to parse causing the error.pos
- The index in jsonStr where the error is detected.errStr
- A string describing the cause of the error.
-
-
Method Detail
-
getErrPos
public int getErrPos()
Returns the error position in the JSON object.- Returns:
- The error position in the JSON object.
-
getErrStr
public java.lang.String getErrStr()
Returns the error message.- Returns:
- The error message.
-
getErrMsg
public java.lang.String getErrMsg()
Returns a multi line error message string with the original string to parse in the first line and a pointer where the error was detected in the second line and the error in the last line.- Returns:
- The error message.
-
-