java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.money.MonetaryException
javax.money.format.MonetaryParseException
- All Implemented Interfaces:
Serializable
Signals that an error has been reached unexpectedly while parsing.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CharSequenceThe original input data.private intThe zero-based character offset into the string being parsed at which the error was found during parsing.private static final longserialVersionUID. -
Constructor Summary
ConstructorsConstructorDescriptionMonetaryParseException(CharSequence parsedData, int errorIndex) Constructs a MonetaryParseException with the parsed text and offset.MonetaryParseException(String message, CharSequence parsedData, int errorIndex) Constructs a MonetaryParseException with the specified detail message, parsed text and index. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the index where the error was found.getInput()Returns the string that was being parsed.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID.- See Also:
-
errorIndex
private int errorIndexThe zero-based character offset into the string being parsed at which the error was found during parsing. -
data
The original input data.
-
-
Constructor Details
-
MonetaryParseException
Constructs a MonetaryParseException with the specified detail message, parsed text and index. A detail message is a String that describes this particular exception.- Parameters:
message- the detail messageparsedData- the parsed text, should not be nullerrorIndex- the position where the error is found while parsing.
-
MonetaryParseException
Constructs a MonetaryParseException with the parsed text and offset. A detail message is a String that describes this particular exception.- Parameters:
parsedData- the parsed text, should not be nullerrorIndex- the position where the error is found while parsing.
-
-
Method Details
-
getErrorIndex
public int getErrorIndex()Returns the index where the error was found.- Returns:
- the index where the error was found
-
getInput
Returns the string that was being parsed.- Returns:
- the parsed input string, or
null, ifnullwas passed as input.
-