BeanIO 2.0.4

org.beanio.internal.util
Class JsonUtil

java.lang.Object
  extended by org.beanio.internal.util.JsonUtil

public class JsonUtil
extends Object

Utility class for working with JSON formatted values.

Since:
2.0
Author:
Kevin Seim

Method Summary
static Boolean toBoolean(String text)
          Parses a JSON formatted boolean from text.
static Number toNumber(String text)
          Parses a JSON formatted number from text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toBoolean

public static Boolean toBoolean(String text)
                         throws IllegalArgumentException
Parses a JSON formatted boolean from text.

Parameters:
text - the text to parse
Returns:
the parsed Boolean
Throws:
IllegalArgumentException - if the text is not a valid boolean

toNumber

public static Number toNumber(String text)
                       throws NumberFormatException
Parses a JSON formatted number from text.

Parameters:
text - the text to parse
Returns:
the parsed Number
Throws:
NumberFormatException - if the text is not a valid number

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim