Package javax.measure.format
Class MeasurementParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.measure.MeasurementException
javax.measure.format.MeasurementParseException
- All Implemented Interfaces:
Serializable
Signals that an error has been reached unexpectedly while parsing.
- Since:
- 2.0
- Version:
- 1.1, March 27, 2018
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CharSequenceThe original input data.private intThe zero-based character position in the string being parsed at which the error was found while parsing.private static final longFor cross-version compatibility. -
Constructor Summary
ConstructorsConstructorDescriptionMeasurementParseException(CharSequence parsedData, int position) Constructs a MeasurementParseException with the parsed text and offset.MeasurementParseException(String message) Constructs a MeasurementParseException with the specified detail message.MeasurementParseException(String message, CharSequence parsedData, int position) Constructs a MeasurementParseException with the specified detail message, parsed text and index.Constructs a MeasurementParseException with the specified cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the string that was being parsed.intReturns the position where the error was found.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 serialVersionUIDFor cross-version compatibility.- See Also:
-
position
private int positionThe zero-based character position in the string being parsed at which the error was found while parsing. -
data
The original input data.
-
-
Constructor Details
-
MeasurementParseException
Constructs a MeasurementParseException 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 nullposition- the position where the error was found while parsing.
-
MeasurementParseException
Constructs a MeasurementParseException 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 nullposition- the position where the error is found while parsing.
-
MeasurementParseException
Constructs a MeasurementParseException with the specified cause.- Parameters:
cause- the root cause
-
MeasurementParseException
Constructs a MeasurementParseException with the specified detail message.- Parameters:
message- the detail message
-
-
Method Details
-
getPosition
public int getPosition()Returns the position where the error was found.- Returns:
- the position of the error
-
getParsedString
Returns the string that was being parsed.- Returns:
- the parsed string, or
null, ifnullwas passed as input.
-