Module org.controlsfx.controls
Interface Parser<T>
-
- Type Parameters:
T
- Type of input to the Parser
- All Known Implementing Classes:
NumberParser
,StringParser
public interface Parser<T>
A parser accepts a string and returns aPredicate
depending on its implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Predicate<T>
aggregate(String text)
Aggregates a text i.e.String
getErrorMessage()
A string with the error message if the parser fails to parse the supplied string.String
getSymbol(String text)
Return the symbol related to an operator text which can be used with this parser.boolean
isValid(String text)
Checks if the supplied text is valid or not.List<String>
operators()
Returns the list of operators which can be used with this parser.Predicate<T>
parse(String text)
-
-
-
Method Detail
-
operators
List<String> operators()
Returns the list of operators which can be used with this parser.- Returns:
- A list of operators.
-
getSymbol
String getSymbol(String text)
Return the symbol related to an operator text which can be used with this parser.- Parameters:
text
- The operator text- Returns:
- A symbol.
-
isValid
boolean isValid(String text)
Checks if the supplied text is valid or not.- Parameters:
text
- The text to be validated.- Returns:
- true if text is valid, else returns false.
-
getErrorMessage
String getErrorMessage()
A string with the error message if the parser fails to parse the supplied string.- Returns:
- An error message if the parse fails.
-
-