Package org.apache.commons.jexl3.parser
Class NumberParser
java.lang.Object
org.apache.commons.jexl3.parser.NumberParser
- All Implemented Interfaces:
Serializable
Parses number literals.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final DecimalFormatJEXL locale-neutral big decimal format.The expected class.private NumberThe type literal value.private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) NumberParserassignNatural(boolean negative, String natural) Sets this node as a natural literal.(package private) NumberParserassignNatural(String str) Sets this node as an (optionally) signed natural literal.(package private) NumberParserassignReal(boolean negative, String s) Sets this node as a real literal.(package private) NumberParserassignReal(String str) Sets this node as an (optionally) signed real literal.(package private) Number(package private) booleanprivate static booleanisNegative(Token token) private static intmaxBigIntegerDigits(int base) Returns the maximum digit count allowed for a BigInteger literal in the given base.(package private) static NumberparseDouble(Token negative, Token s) (package private) static NumberparseInteger(Token negative, Token s) toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
BIGDF
JEXL locale-neutral big decimal format. -
literal
The type literal value. -
clazz
The expected class.
-
-
Constructor Details
-
NumberParser
public NumberParser() -
NumberParser
-
-
Method Details
-
maxBigIntegerDigits
private static int maxBigIntegerDigits(int base) Returns the maximum digit count allowed for a BigInteger literal in the given base. When a JEXL engine with a bounded MathContext is active on the current thread, the engine's precision is converted to an equivalent bit limit, then to max digits for the base. Otherwise MAX_BIGINTEGER_DIGITS applies. At runtime, JexlArithmetic.checkBigIntegerPrecision() enforces the bit-length limit (f014, f013). -
isNegative
-
parseDouble
-
parseInteger
-
assignNatural
Sets this node as a natural literal. Originally from OGNL.- Parameters:
negative- whether the natural should be negativenatural- The natural as string- Returns:
- this parser instance
-
assignNatural
Sets this node as an (optionally) signed natural literal. Originally from OGNL.- Parameters:
str- The natural as string- Returns:
- this parser instance
-
assignReal
Sets this node as a real literal. Originally from OGNL.- Parameters:
negative- whether the real should be negatives- The real as string- Returns:
- this parser instance
-
assignReal
Sets this node as an (optionally) signed real literal. Originally from OGNL.- Parameters:
str- The real as string- Returns:
- this parser instance
-
getLiteralClass
-
getLiteralValue
Number getLiteralValue() -
isInteger
boolean isInteger() -
toString
-