public class JsUtil extends Object
Constructor and Description |
---|
JsUtil() |
Modifier and Type | Method and Description |
---|---|
static JavaScriptObject |
eval(String code)
Creates a new javascript object from the JSON text.
|
static boolean |
isInteger(String value)
Returns
true if the value is a integer. |
static <X> List<X> |
subList(List<X> list,
int start,
int end)
Returns a section of the given list.
|
static Element[] |
toElementArray(JavaScriptObject jsArray)
Converts a native javascript array to an element array.
|
static JavaScriptObject |
toJavaScriptArray(Object[] array)
Converts a object array to a javascript array.
|
static <V> JavaScriptObject |
toJavaScriptObject(Map<String,V> params)
Converts a map into a javascript object, setting all values as properties.
|
public static JavaScriptObject eval(String code)
code
- the JSON textpublic static boolean isInteger(String value)
true
if the value is a integer.value
- the value to testpublic static <X> List<X> subList(List<X> list, int start, int end)
list
- the liststart
- the start indexend
- the end indexpublic static Element[] toElementArray(JavaScriptObject jsArray)
jsArray
- the array to be convertedpublic static JavaScriptObject toJavaScriptArray(Object[] array)
array
- the java arraypublic static <V> JavaScriptObject toJavaScriptObject(Map<String,V> params)
params
- the parametersCopyright © 2015. All rights reserved.