-
- All Known Implementing Classes:
BooleanParser,CharParser,DateParser,DefaultDoubleParser,DefaultDurationParser,DefaultFloatParser,DefaultIntParser,DefaultLongParser,DefaultMoneyParser,DefaultNumericParser,DefaultPeriodParser,DoubleParser,DurationParser,FloatParser,HexBinaryParser,IntParser,ISODateParser,ISOTimeOfDayParser,ISOTimestampParser,LongParser,MoneyParser,NumericParser,PeriodParser,StringParser,TextIp4Parser,TextIp6Parser,TimeParser,TimestampParser
public interface TokenParserConverts text values into token values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetParseError()Whenparsemethod returns false this method can be used to retrieve the specific error message detailing why the parsing failed.booleanparse(String text)Parses the given text string into a token value.voidsetTarget(ScalarSettable target)Sets the buffer for holding parsed values.
-
-
-
Method Detail
-
setTarget
void setTarget(ScalarSettable target)
Sets the buffer for holding parsed values. A reference to this container is held and accessed only when an formatting is requested.- Parameters:
target- the value buffer in which to store parsed values
-
parse
boolean parse(String text)
Parses the given text string into a token value. If the parse succeeds, the result is stored in the target buffer. If it fails, the contents of the target buffer are unchanged and information regarding failure will be saved that is accessible by calling thegetParseErrormethod.- Parameters:
text- text string to convert. Callers should not assume it is safe to passnull.- Returns:
trueif the parsing succeeded,falseotherwise.
-
getParseError
String getParseError()
Whenparsemethod returns false this method can be used to retrieve the specific error message detailing why the parsing failed. If the last parse was successful an empty string will be returned- Returns:
- a message detailing any parse errors that occurred
during the last call to
parse.
-
-