Top Description Fields Constructors Methods
javax.measure.format

public Class MeasurementParseException

extends MeasurementException
Class Inheritance
Imports
javax.measure.MeasurementException

Signals that an error has been reached unexpectedly while parsing.
Author
Werner Keil
Since
2.0
Version
1.1, March 27, 2018

Field Summary

Modifier and TypeField and Description
private CharSequence
data

The original input data.

private int
position

The zero-based character position in the string being parsed at which the error was found while parsing.

private static final long

Constructor Summary

AccessConstructor and Description
public
MeasurementParseException(String
the detail message
message
,
CharSequence
the parsed text, should not be null
parsedData
,
int
the position where the error was found while parsing.
position
)

Constructs a MeasurementParseException with the specified detail message, parsed text and index.

public
MeasurementParseException(CharSequence
the parsed text, should not be null
parsedData
,
int
the position where the error is found while parsing.
position
)

Constructs a MeasurementParseException with the parsed text and offset.

public
MeasurementParseException(Throwable
the root cause
cause
)

Constructs a MeasurementParseException with the specified cause.

public
MeasurementParseException(String
the detail message
message
)

Constructs a MeasurementParseException with the specified detail message.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the parsed string, or null, if null was passed as input.
getParsedString
()

Returns the string that was being parsed.

public int

Returns:

the position of the error
getPosition
()

Returns the position where the error was found.

Field Detail

databack to summary
private CharSequence data

The original input data.

positionback to summary
private int position

The zero-based character position in the string being parsed at which the error was found while parsing.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.measure.MeasurementException.serialVersionUID.

For cross-version compatibility.

Constructor Detail

MeasurementParseExceptionback to summary
public MeasurementParseException(String message, CharSequence parsedData, int position)

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:String

the detail message

parsedData:CharSequence

the parsed text, should not be null

position:int

the position where the error was found while parsing.

MeasurementParseExceptionback to summary
public MeasurementParseException(CharSequence parsedData, int position)

Constructs a MeasurementParseException with the parsed text and offset. A detail message is a String that describes this particular exception.

Parameters
parsedData:CharSequence

the parsed text, should not be null

position:int

the position where the error is found while parsing.

MeasurementParseExceptionback to summary
public MeasurementParseException(Throwable cause)

Constructs a MeasurementParseException with the specified cause.

Parameters
cause:Throwable

the root cause

MeasurementParseExceptionback to summary
public MeasurementParseException(String message)

Constructs a MeasurementParseException with the specified detail message.

Parameters
message:String

the detail message

Method Detail

getParsedStringback to summary
public String getParsedString()

Returns the string that was being parsed.

Returns:String

the parsed string, or null, if null was passed as input.

getPositionback to summary
public int getPosition()

Returns the position where the error was found.

Returns:int

the position of the error