Class NumberUtils
- java.lang.Object
-
- com.api.jsonata4java.expressions.utils.NumberUtils
-
- All Implemented Interfaces:
Serializable
public class NumberUtils extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NumberUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.node.ValueNodeconvertNumberToValueNode(String number)The convertNumberToValueNode method converts the string passed in to a suitable subclass of ValueNode depending on whether it is an integer or decimal.
-
-
-
Method Detail
-
convertNumberToValueNode
public static final com.fasterxml.jackson.databind.node.ValueNode convertNumberToValueNode(String number)
The convertNumberToValueNode method converts the string passed in to a suitable subclass of ValueNode depending on whether it is an integer or decimal. For consistency with the JavaScript implementation of JSONata, we limit the size of the numbers that we handle to be within the range Double.MAX_VALUE and -Double.MAX_VALUE. If we did not do this we would need to implement a lot of extra code to handle BigInteger and BigDecimal.- Parameters:
number- The string representation of the number to convert- Returns:
- ValueNode The ValueNode representation of the number contained in the input string
- Throws:
EvaluateRuntimeException- If the number represented by the string is outside of the valid range or if the string does not contain a valid number.
-
-