Package ej.rest.util
Class Tool
- java.lang.Object
-
- ej.rest.util.Tool
-
public class Tool extends Object
-
-
Constructor Summary
Constructors Constructor Description Tool()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidnoSpace(String string)Throw an exception if the string contains whitespace.static ObjectstringToValue(String s)Try to convert a string into a number, boolean, or null.
-
-
-
Method Detail
-
stringToValue
public static Object stringToValue(String s)
Try to convert a string into a number, boolean, or null. If the string can't be converted, return the string.- Parameters:
s- A String.- Returns:
- A simple JSON value.
-
noSpace
public static void noSpace(String string) throws JSONException
Throw an exception if the string contains whitespace. Whitespace is not allowed in tagNames and attributes.- Parameters:
string-- Throws:
JSONException
-
-