Package org.greenbytes.http.sfv
Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- org.greenbytes.http.sfv.ParseException
-
- All Implemented Interfaces:
Serializable
public class ParseException extends IllegalArgumentException
IllegalArgumentException, augmented with details.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ParseException(String message, String input, int position)Create instance ofParseException.ParseException(String message, String input, int position, Throwable cause)Create instance ofParseException.ParseException(String message, CharBuffer input)Create instance ofParseException.ParseException(String message, CharBuffer input, int position, Throwable cause)Create instance ofParseException.ParseException(String message, CharBuffer input, Throwable cause)Create instance ofParseException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetData()Return the raw data on which the parser operated..StringgetDiagnostics()Gets additional diagnostics.intgetPosition()Return the approximate position where the parse error occurred.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ParseException
public ParseException(String message, String input, int position, Throwable cause)
Create instance ofParseException.- Parameters:
message- exception message.input- parser input.position- position where parse exception occurred.cause- underlying exception, if any.
-
ParseException
public ParseException(String message, CharBuffer input, int position, Throwable cause)
Create instance ofParseException.- Parameters:
message- exception message.input- parser input.position- position where parse exception occurred.cause- underlying exception, if any.
-
ParseException
public ParseException(String message, String input, int position)
Create instance ofParseException.- Parameters:
message- exception message.input- parser input.position- position where parse exception occurred.
-
ParseException
public ParseException(String message, CharBuffer input, Throwable cause)
Create instance ofParseException.- Parameters:
message- exception message.input- current state of input buffer.cause- underlying exception, if any.
-
ParseException
public ParseException(String message, CharBuffer input)
Create instance ofParseException.- Parameters:
message- exception message.input- current state of input buffer.
-
-
Method Detail
-
getData
public String getData()
Return the raw data on which the parser operated..- Returns:
- the raw data.
-
getPosition
public int getPosition()
Return the approximate position where the parse error occurred.- Returns:
- the position.
-
getDiagnostics
public String getDiagnostics()
Gets additional diagnostics.- Returns:
- two lines of data; first contains the raw parse data enclosed in ">>" and "<<", the second ASCII artwork with "^" pointing to the parse position, followed by the actual exception message.
-
-