public class JSOHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
addProperties(com.google.gwt.core.client.JavaScriptObject destination,
com.google.gwt.core.client.JavaScriptObject propertiesObject)
Adds all properties and methods from the propertiesObject to the destination object.
|
static void |
apply(com.google.gwt.core.client.JavaScriptObject config,
com.google.gwt.core.client.JavaScriptObject jsObj) |
static com.google.gwt.core.client.JavaScriptObject |
arrayConvert(com.google.gwt.core.client.JavaScriptObject[] array) |
static com.google.gwt.core.client.JavaScriptObject |
arrayConvert(java.lang.Object[] array) |
static java.lang.Object |
arrayGetObject(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static int |
arrayLength(com.google.gwt.core.client.JavaScriptObject array) |
static void |
arraySet(com.google.gwt.core.client.JavaScriptObject array,
int index,
com.google.gwt.core.client.JavaScriptObject value) |
static void |
arraySet(com.google.gwt.core.client.JavaScriptObject array,
int index,
java.lang.Object value) |
static java.lang.Object |
callMethod(com.google.gwt.core.client.JavaScriptObject target,
java.lang.String methodName,
java.lang.Object[] arguments)
Invoke a method on some JavaScript object, passing in the specified array of parameters.
|
static com.google.gwt.core.client.JavaScriptObject |
cleanProperties(com.google.gwt.core.client.JavaScriptObject properties,
boolean copyProperties)
Removes non-transferable properties from the supplied object
(e.g.
|
static com.google.gwt.core.client.JavaScriptObject |
convertMapToJavascriptObject(java.util.Map valueMap)
Converts the parameter Map to an equivalent Javascript object - see
JavaToJavaScriptConversion
for details of the conversions that take place. |
static com.google.gwt.core.client.JavaScriptObject |
convertMapToJavascriptObject(java.util.Map valueMap,
boolean strict) |
static java.lang.Object[] |
convertToArray(com.google.gwt.core.client.JavaScriptObject object)
Convert a JavaScript object to an Object[], following the rules described
in the
JS -> Java conversion article . |
static com.google.gwt.core.client.JavaScriptObject |
convertToCellArray(int[][] cells) |
static java.lang.Object |
convertToJava(com.google.gwt.core.client.JavaScriptObject object)
Convert a JavaScriptObject to the appropriate type of Java Object, following the rules described
in the
JS -> Java conversion article . |
static java.lang.Object |
convertToJava(com.google.gwt.core.client.JavaScriptObject object,
boolean listAsArray)
Convert a JavaScriptObject to the appropriate type of Java Object, following the rules described
in the
JS -> Java conversion article |
static java.lang.Boolean[] |
convertToJavaBooleanArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.util.Date |
convertToJavaDate(com.google.gwt.core.client.JavaScriptObject val) |
static java.util.Date[] |
convertToJavaDateArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Double[] |
convertToJavaDoubleArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Float[] |
convertToJavaFloatArray(com.google.gwt.core.client.JavaScriptObject array) |
static int[] |
convertToJavaIntArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Integer[] |
convertToJavaIntegerArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Integer[] |
convertToJavaInterArray(com.google.gwt.core.client.JavaScriptObject array)
Deprecated.
deprecated in favor of
convertToJavaIntegerArray(com.google.gwt.core.client.JavaScriptObject) |
static java.lang.Object[] |
convertToJavaObjectArray(com.google.gwt.core.client.JavaScriptObject array) |
static RefDataClass[] |
convertToJavaRefDataClassArray(com.google.gwt.core.client.JavaScriptObject nativeArray) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(boolean[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(byte[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(char[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(double[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(float[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(int[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(long[] array) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(java.lang.Object[] array)
Converts the parameter Object array to an equivalent Javascript array - see
JavaToJavaScriptConversion for details of the conversions
that take place. |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(java.lang.Object[] array,
boolean strict) |
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(short[] array) |
static com.google.gwt.core.client.JsDate |
convertToJavaScriptDate(java.util.Date date) |
static java.lang.String[] |
convertToJavaStringArray(com.google.gwt.core.client.JavaScriptObject array) |
static <O extends com.google.gwt.core.client.JavaScriptObject> |
convertToJsArray(O[] array) |
static java.util.List |
convertToList(com.google.gwt.core.client.JavaScriptObject object)
Convert a JavaScript object to a List, following the rules described
in the
JS -> Java conversion article . |
static java.util.Map |
convertToMap(com.google.gwt.core.client.JavaScriptObject jsObj)
Convert a JavaScript object containing key:value pairs to a Java Map, following the rules described
in the
JS -> Java conversion article . |
static java.util.Map |
convertToMap(com.google.gwt.core.client.JavaScriptObject jsObj,
boolean listAsArray)
Convert a JavaScript object containing key:value pairs to a Java Map, following the rules described
in the
JS -> Java conversion article |
static java.lang.String |
convertToString(java.lang.Object obj) |
static com.google.gwt.core.client.JavaScriptObject |
createJavaScriptArray() |
static com.google.gwt.core.client.JavaScriptObject |
createObject() |
static void |
deleteAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static void |
deleteAttributeIfExists(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static double |
doubleValue(java.lang.Number num) |
static com.google.gwt.core.client.JavaScriptObject |
eval(java.lang.String jsFrag)
Evaluate the passed string as Javascript
|
static int |
getArrayLength(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.String |
getArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.String |
getAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static boolean |
getAttributeAsBoolean(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr)
Returns attribute value set as a Boolean.
|
static java.lang.Boolean |
getAttributeAsBoolean(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
boolean allowNull)
Returns attribute value set as a Boolean.
|
static java.util.Date |
getAttributeAsDate(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.lang.Double |
getAttributeAsDouble(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static double[] |
getAttributeAsDoubleArray(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static com.google.gwt.user.client.Element |
getAttributeAsElement(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.lang.Float |
getAttributeAsFloat(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.lang.Integer |
getAttributeAsInt(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static int[] |
getAttributeAsIntArray(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static com.google.gwt.core.client.JavaScriptObject |
getAttributeAsJavaScriptObject(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static com.google.gwt.core.client.JavaScriptObject[] |
getAttributeAsJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.util.Map |
getAttributeAsMap(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr)
Returns attribute "attr" of JavaScriptObject "elem", converted to a Map following the rules described
in the
JS -> Java conversion article |
static java.lang.Object |
getAttributeAsObject(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.lang.String[] |
getAttributeAsStringArray(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static java.lang.Boolean |
getBooleanArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static int[][] |
getCellArray(com.google.gwt.core.client.JavaScriptObject jsCells) |
static java.lang.String |
getClassName(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
Returns the javascript class name.
|
static java.util.Date |
getDateArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int i) |
static double |
getdoubleArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.Double |
getDoubleArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static double |
getDoubleValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
int i) |
static com.google.gwt.user.client.Element |
getElementValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
int i)
This is used to access Element array as JavaScriptObject
|
static float |
getfloatArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.Float |
getFloatArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static int |
getIntArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.Integer |
getIntegerArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static int |
getIntValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
int i) |
static int |
getJavaScriptObjectArraySize(com.google.gwt.core.client.JavaScriptObject elem) |
static com.google.gwt.core.client.JsDate |
getJSLogicalDate(java.util.Date date) |
static com.google.gwt.core.client.JsDate |
getJSLogicalDate(int year,
int month,
int date) |
static com.google.gwt.core.client.JsDate |
getJSLogicalTime(java.util.Date date) |
static com.google.gwt.core.client.JsDate |
getJSLogicalTime(int hour,
int minute,
int second,
int millisecond) |
static com.google.gwt.core.client.JavaScriptObject |
getJSOArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.Object |
getObjectArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index) |
static java.lang.String[] |
getProperties(com.google.gwt.core.client.JavaScriptObject jsObj) |
static java.lang.String |
getPropertiesAsString(com.google.gwt.core.client.JavaScriptObject jsObj) |
static java.lang.String |
getStringValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
int i) |
static com.google.gwt.core.client.JavaScriptObject |
getValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem,
int i) |
static boolean |
isArray(com.google.gwt.core.client.JavaScriptObject jsObj) |
static boolean |
isJavaArray(java.lang.Object obj) |
static boolean |
isJavaBoolean(java.lang.Object obj) |
static boolean |
isJavaDate(java.lang.Object obj) |
static boolean |
isJavaDouble(java.lang.Object obj) |
static boolean |
isJavaFloat(java.lang.Object obj) |
static boolean |
isJavaInteger(java.lang.Object obj) |
static boolean |
isJavaList(java.lang.Object obj) |
static boolean |
isJavaMap(java.lang.Object obj) |
static boolean |
isJavaNumber(java.lang.Object obj) |
static boolean |
isJavaString(java.lang.Object obj) |
static boolean |
isJSO(java.lang.Object object) |
static boolean |
isScClassInstance(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
Returns whether the supplied JavaScriptObject is a SmartClient class instance.
|
static boolean |
isScClassObject(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
Returns whether the supplied JavaScriptObject is a SmartClient class (a Class object
itself, rather than an instance of a class).
|
static com.google.gwt.core.client.JavaScriptObject[] |
listToArray(java.util.List list) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
boolean value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
char value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
java.util.Date value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
double value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
com.google.gwt.core.client.JavaScriptObject value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
long value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
java.lang.Object value) |
static void |
setArrayValue(com.google.gwt.core.client.JavaScriptObject array,
int index,
java.lang.String value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
boolean value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Boolean value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Boolean[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.util.Date value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.util.Date[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
double value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
double[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Double[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
float[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Float[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
Function handler) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
int value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
int[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Integer[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
com.google.gwt.core.client.JavaScriptObject value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
com.google.gwt.core.client.JavaScriptObject[] value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Long value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Long[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject jsObj,
java.lang.String attr,
java.util.Map valueMap)
Sets attribute "attr" on Javascript object "jsObj" to the JavaScript equivalent of "valueMap".
|
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Number value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Object value)
Set the value of attribute "attr" in object "elem" to the Object "value"
|
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.String value) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.String[] values) |
static void |
setAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
ValueEnum[] values) |
static void |
setNullAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr) |
static void |
setObjectAttribute(com.google.gwt.core.client.JavaScriptObject elem,
java.lang.String attr,
java.lang.Object object) |
static void |
throwUnconvertibleObjectException(java.lang.Object object,
java.lang.String messageDetail) |
static com.google.gwt.core.client.JavaScriptObject[] |
toArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Boolean |
toBoolean(boolean value) |
static java.util.Date |
toDate(double millis)
Converts a time to a Java
Date object. |
static com.google.gwt.core.client.JavaScriptObject |
toDateJS(java.util.Date date) |
static java.lang.Double |
toDouble(double value) |
static com.google.gwt.user.client.Element[] |
toElementArray(com.google.gwt.core.client.JavaScriptObject array) |
static java.lang.Float |
toFloat(float value) |
static java.lang.Integer |
toInteger(int value) |
static java.lang.Long |
toLong(double value) |
public static java.lang.String getClassName(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
public static boolean isScClassInstance(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
the
- object to evaluatepublic static boolean isScClassObject(com.google.gwt.core.client.JavaScriptObject javaScriptObject)
the
- object to evaluatepublic static com.google.gwt.core.client.JavaScriptObject eval(java.lang.String jsFrag)
jsFrag
- the string to evaluatepublic static boolean isJSO(java.lang.Object object)
public static double doubleValue(java.lang.Number num)
public static java.lang.String getAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.String value)
public static com.google.gwt.core.client.JavaScriptObject getAttributeAsJavaScriptObject(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static com.google.gwt.core.client.JavaScriptObject[] getAttributeAsJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static com.google.gwt.core.client.JavaScriptObject[] toArray(com.google.gwt.core.client.JavaScriptObject array)
public static boolean isArray(com.google.gwt.core.client.JavaScriptObject jsObj)
public static com.google.gwt.user.client.Element[] toElementArray(com.google.gwt.core.client.JavaScriptObject array)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, com.google.gwt.core.client.JavaScriptObject[] value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, int[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, float[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, double[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.String[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Integer[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Float[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Boolean[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Double[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Long[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.util.Date[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, ValueEnum[] values)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Object value)
This method converts the value passed in to an equivalent
object in JavaScript before storing on the underlying data object - see
JavaToJavaScriptConversion
for details of the conversions
that take place.
Developers can use setObjectAttribute(JavaScriptObject, String, Object)
to store Java objects without converting to JavaScript.
elem
- the JavaScriptObject on which to set the attributeattr
- the attribute namevalue
- the attribute value.public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, com.google.gwt.core.client.JavaScriptObject value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, int value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Number value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Long value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Boolean value)
public static void setNullAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static void deleteAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static void deleteAttributeIfExists(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, boolean value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, double value)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, Function handler)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.util.Date value)
public static void setObjectAttribute(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, java.lang.Object object)
public static com.google.gwt.user.client.Element getAttributeAsElement(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.lang.Integer getAttributeAsInt(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.lang.Double getAttributeAsDouble(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.util.Date getAttributeAsDate(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.lang.Float getAttributeAsFloat(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static int[] getAttributeAsIntArray(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static double[] getAttributeAsDoubleArray(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.lang.String[] getAttributeAsStringArray(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static int getJavaScriptObjectArraySize(com.google.gwt.core.client.JavaScriptObject elem)
public static int getIntValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, int i)
public static double getDoubleValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, int i)
public static java.lang.String getStringValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, int i)
public static com.google.gwt.core.client.JavaScriptObject getValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, int i)
public static int[][] getCellArray(com.google.gwt.core.client.JavaScriptObject jsCells)
public static com.google.gwt.core.client.JavaScriptObject convertToCellArray(int[][] cells)
public static boolean getAttributeAsBoolean(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
getAttributeAsBoolean
will return Boolean false
if the attribute value is null
or not a Boolean. Use the three parameter
variant of this API getAttributeAsBoolean(JavaScriptObject, String, boolean)
if you want null
returned for null
attribute values.elem
- the JavaScriptObject containing the propertyattr
- the property namepublic static java.lang.Boolean getAttributeAsBoolean(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr, boolean allowNull)
null
or not a Boolean, the return value depends upon allowNull
. If
allowNull
is true, null
will be returned; otherwise Boolean
false
will be returned. For a simpler approach that never returns
null
, use the two parameter variant of this API
getAttributeAsBoolean(JavaScriptObject, String)
.elem
- the JavaScriptObject containing the propertyattr
- the property nameallowNull
- whether to permit a null
return valuepublic static java.lang.Object getAttributeAsObject(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
public static java.util.Map getAttributeAsMap(com.google.gwt.core.client.JavaScriptObject elem, java.lang.String attr)
JS -> Java conversion article
elem
- JavaScriptObject containing the attributeattr
- The attribute namepublic static com.google.gwt.core.client.JavaScriptObject[] listToArray(java.util.List list)
public static com.google.gwt.core.client.JavaScriptObject arrayConvert(java.lang.Object[] array)
public static com.google.gwt.core.client.JavaScriptObject arrayConvert(com.google.gwt.core.client.JavaScriptObject[] array)
public static int arrayLength(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Object arrayGetObject(com.google.gwt.core.client.JavaScriptObject array, int index)
public static void arraySet(com.google.gwt.core.client.JavaScriptObject array, int index, java.lang.Object value)
public static void arraySet(com.google.gwt.core.client.JavaScriptObject array, int index, com.google.gwt.core.client.JavaScriptObject value)
public static com.google.gwt.user.client.Element getElementValueFromJavaScriptObjectArray(com.google.gwt.core.client.JavaScriptObject elem, int i)
public static com.google.gwt.core.client.JavaScriptObject createObject()
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(boolean[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(char[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(byte[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(short[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(int[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(float[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(double[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(long[] array)
public static java.lang.Object convertToJava(com.google.gwt.core.client.JavaScriptObject object, boolean listAsArray)
JS -> Java conversion article
object
- JavaScriptObject to convertlistAsArray
- Should arrays be converted to Object[] or Listpublic static java.lang.Object convertToJava(com.google.gwt.core.client.JavaScriptObject object)
JS -> Java conversion article
.
Any arrays encountered during conversion will be converted to Java ArrayList
sobject
- JavaScriptObject to convertpublic static java.util.Map convertToMap(com.google.gwt.core.client.JavaScriptObject jsObj, boolean listAsArray)
JS -> Java conversion article
jsObj
- the JavaScript object to convertlistAsArray
- Should arrays be converted to Object[] or Listjava.lang.IllegalArgumentException
- if unable to convert the passed JavaScript object to a mappublic static java.util.Map convertToMap(com.google.gwt.core.client.JavaScriptObject jsObj)
JS -> Java conversion article
.
Any arrays encountered during the conversion process will be converted to Java ArrayList
sjsObj
- the JavaScript object to convertjava.lang.IllegalArgumentException
- if unable to convert the passed JavaScript object to a mappublic static java.lang.Object[] convertToArray(com.google.gwt.core.client.JavaScriptObject object)
JS -> Java conversion article
.
If the JavaScript object is not an array in Javascript, a new array will be created
containing the converted object as the only entry.object
- the JavaScript object to convertpublic static java.util.List convertToList(com.google.gwt.core.client.JavaScriptObject object)
JS -> Java conversion article
.
If the JavaScript object is not an array in JavaScript, a new List will be created containing
the converted object as the only entry.object
- the JavaScript object to convertpublic static com.google.gwt.core.client.JsDate convertToJavaScriptDate(java.util.Date date)
public static java.util.Date convertToJavaDate(com.google.gwt.core.client.JavaScriptObject val)
public static java.lang.String convertToString(java.lang.Object obj)
public static boolean isJavaDate(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaNumber(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaInteger(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaFloat(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaDouble(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaString(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaBoolean(java.lang.Object obj)
obj
- the objectpublic static boolean isJavaList(java.lang.Object obj)
public static boolean isJavaMap(java.lang.Object obj)
public static boolean isJavaArray(java.lang.Object obj)
obj
- the objectpublic static <O extends com.google.gwt.core.client.JavaScriptObject> com.google.gwt.core.client.JsArray<O> convertToJsArray(O[] array)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(java.lang.Object[] array)
JavaToJavaScriptConversion
for details of the conversions
that take place.array
- the Java Object array to convertpublic static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(java.lang.Object[] array, boolean strict)
public static void throwUnconvertibleObjectException(java.lang.Object object, java.lang.String messageDetail)
public static java.lang.Integer toInteger(int value)
public static java.lang.Long toLong(double value)
public static java.lang.Float toFloat(float value)
public static java.lang.Double toDouble(double value)
public static java.util.Date toDate(double millis)
Date
object.
Note: If needing to convert a JavaScript object, it is preferable to use
convertToJavaDate(JavaScriptObject)
instead because that function is able to
convert to LogicalDate
and LogicalTime
instances as needed.
millis
- number of milliseconds since January 1, 1970, 00:00:00 GMT.Date
representing the given time.public static com.google.gwt.core.client.JavaScriptObject toDateJS(java.util.Date date)
public static com.google.gwt.core.client.JsDate getJSLogicalDate(java.util.Date date)
public static com.google.gwt.core.client.JsDate getJSLogicalDate(int year, int month, int date)
public static com.google.gwt.core.client.JsDate getJSLogicalTime(java.util.Date date)
public static com.google.gwt.core.client.JsDate getJSLogicalTime(int hour, int minute, int second, int millisecond)
public static java.lang.Boolean toBoolean(boolean value)
public static com.google.gwt.core.client.JavaScriptObject createJavaScriptArray()
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, java.util.Date value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, java.lang.String value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, double value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, long value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, boolean value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, char value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, com.google.gwt.core.client.JavaScriptObject value)
public static void setArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index, java.lang.Object value)
public static java.lang.String getArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static com.google.gwt.core.client.JavaScriptObject getJSOArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.lang.Object getObjectArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.lang.Boolean getBooleanArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static int getIntArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static float getfloatArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static double getdoubleArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.lang.Integer getIntegerArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.lang.Float getFloatArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.lang.Double getDoubleArrayValue(com.google.gwt.core.client.JavaScriptObject array, int index)
public static java.util.Date getDateArrayValue(com.google.gwt.core.client.JavaScriptObject array, int i)
public static int getArrayLength(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Boolean[] convertToJavaBooleanArray(com.google.gwt.core.client.JavaScriptObject array)
public static int[] convertToJavaIntArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Integer[] convertToJavaInterArray(com.google.gwt.core.client.JavaScriptObject array)
convertToJavaIntegerArray(com.google.gwt.core.client.JavaScriptObject)
public static java.lang.Integer[] convertToJavaIntegerArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.String[] convertToJavaStringArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Float[] convertToJavaFloatArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Double[] convertToJavaDoubleArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.util.Date[] convertToJavaDateArray(com.google.gwt.core.client.JavaScriptObject array)
public static java.lang.Object[] convertToJavaObjectArray(com.google.gwt.core.client.JavaScriptObject array)
public static RefDataClass[] convertToJavaRefDataClassArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
public static void apply(com.google.gwt.core.client.JavaScriptObject config, com.google.gwt.core.client.JavaScriptObject jsObj)
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject jsObj, java.lang.String attr, java.util.Map valueMap)
JavaToJavaScriptConversion
for details of the conversions that take place.jsObj
- the JavaScript object on which to set the attributeattr
- the name of the attribute to setvalueMap
- the Java Map to convert and apply as the attribute valuepublic static com.google.gwt.core.client.JavaScriptObject convertMapToJavascriptObject(java.util.Map valueMap)
JavaToJavaScriptConversion
for details of the conversions that take place.array
- the Java Map to convertpublic static com.google.gwt.core.client.JavaScriptObject convertMapToJavascriptObject(java.util.Map valueMap, boolean strict)
public static java.lang.String[] getProperties(com.google.gwt.core.client.JavaScriptObject jsObj)
public static java.lang.String getPropertiesAsString(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void addProperties(com.google.gwt.core.client.JavaScriptObject destination, com.google.gwt.core.client.JavaScriptObject propertiesObject)
destination
- the destination objectpropertiesObject
- the propertiesObjectpublic static com.google.gwt.core.client.JavaScriptObject cleanProperties(com.google.gwt.core.client.JavaScriptObject properties, boolean copyProperties)
properties
- the supplied object to cleancopyProperties
- whether to copy the object firstpublic static java.lang.Object callMethod(com.google.gwt.core.client.JavaScriptObject target, java.lang.String methodName, java.lang.Object[] arguments)
This method converts the specified parameters to a equivalent
objects in JavaScript before calling the method in JavaScript scope, and will convert any return
value to Java before returning it - see
JavaToJavaScriptConversion
for details of the conversions
that take place.
If the invoked method has no return value, this method will return null.
target
- methodName
- arguments
-