Package org.beanio.internal.util
Class JsonUtil
- java.lang.Object
-
- org.beanio.internal.util.JsonUtil
-
public class JsonUtil extends java.lang.ObjectUtility class for working with JSON formatted values.- Since:
- 2.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.BooleantoBoolean(java.lang.String text)Parses a JSON formatted boolean from text.static java.lang.NumbertoNumber(java.lang.String text)Parses a JSON formatted number from text.
-
-
-
Method Detail
-
toBoolean
public static java.lang.Boolean toBoolean(java.lang.String text) throws java.lang.IllegalArgumentExceptionParses a JSON formatted boolean from text.- Parameters:
text- the text to parse- Returns:
- the parsed
Boolean - Throws:
java.lang.IllegalArgumentException- if the text is not a valid boolean
-
toNumber
public static java.lang.Number toNumber(java.lang.String text) throws java.lang.NumberFormatExceptionParses a JSON formatted number from text.- Parameters:
text- the text to parse- Returns:
- the parsed
Number - Throws:
java.lang.NumberFormatException- if the text is not a valid number
-
-