com.smartgwt.client.util
Class JSOHelper

java.lang.Object
  extended by com.smartgwt.client.util.JSOHelper

public class JSOHelper
extends Object

Internal helper class.


Method Summary
static void addProperties(JavaScriptObject destination, JavaScriptObject propertiesObject)
          Adds all properties and methods from the propertiesObject to the destination object.
static void apply(JavaScriptObject config, JavaScriptObject jsObj)
           
static JavaScriptObject arrayConvert(JavaScriptObject[] array)
           
static JavaScriptObject arrayConvert(Object[] array)
           
static Object arrayGetObject(JavaScriptObject array, int index)
           
static int arrayLength(JavaScriptObject array)
           
static void arraySet(JavaScriptObject array, int index, JavaScriptObject value)
           
static void arraySet(JavaScriptObject array, int index, Object value)
           
static JavaScriptObject cleanProperties(JavaScriptObject properties, boolean copyProperties)
          Removes non-transferable properties from the supplied object (e.g.
static JavaScriptObject convertMapToJavascriptObject(Map valueMap)
           
static JavaScriptObject convertMapToJavascriptObject(Map valueMap, boolean strict)
           
static Object[] convertToArray(JavaScriptObject object)
          Convert a Javascript object to an Object[].
static JavaScriptObject convertToCellArray(int[][] cells)
           
static Object convertToJava(JavaScriptObject object)
           
static Object convertToJava(JavaScriptObject object, boolean listAsArray)
          Convert a JavaScriptObject to the appropriate type of JavaObject.
static Date convertToJavaDate(JavaScriptObject val)
           
static Date[] convertToJavaDateArray(JavaScriptObject array)
           
static Double[] convertToJavaDoubleArray(JavaScriptObject array)
           
static Float[] convertToJavaFloatArray(JavaScriptObject array)
           
static int[] convertToJavaIntArray(JavaScriptObject array)
           
static Integer[] convertToJavaInterArray(JavaScriptObject array)
           
static Object[] convertToJavaObjectArray(JavaScriptObject array)
           
static RefDataClass[] convertToJavaRefDataClassArray(JavaScriptObject nativeArray)
           
static JavaScriptObject convertToJavaScriptArray(boolean[] array)
           
static JavaScriptObject convertToJavaScriptArray(byte[] array)
           
static JavaScriptObject convertToJavaScriptArray(char[] array)
           
static JavaScriptObject convertToJavaScriptArray(double[] array)
           
static JavaScriptObject convertToJavaScriptArray(float[] array)
           
static JavaScriptObject convertToJavaScriptArray(int[] array)
           
static JavaScriptObject convertToJavaScriptArray(long[] array)
           
static JavaScriptObject convertToJavaScriptArray(Object[] array)
           
static JavaScriptObject convertToJavaScriptArray(Object[] array, boolean strict)
           
static JavaScriptObject convertToJavaScriptArray(short[] array)
           
static JsDate convertToJavaScriptDate(Date date)
           
static String[] convertToJavaStringArray(JavaScriptObject array)
           
static
<O extends JavaScriptObject>
JsArray<O>
convertToJsArray(O[] array)
           
static List convertToList(JavaScriptObject object)
          Convert a Javascript object to a List.
static Map convertToMap(JavaScriptObject jsObj)
          Convert a Javascript object containing key:value pairs to a Map.
static Map convertToMap(JavaScriptObject jsObj, boolean listAsArray)
          Convert a Javascript object containing key:value pairs to a Map.
static String convertToString(Object obj)
           
static JavaScriptObject createJavaScriptArray()
           
static JavaScriptObject createObject()
           
static void deleteAttribute(JavaScriptObject elem, String attr)
           
static void deleteAttributeIfExists(JavaScriptObject elem, String attr)
           
static double doubleValue(Number num)
           
static JavaScriptObject eval(String jsFrag)
          Evaluate the passed string as Javascript
static int getArrayLength(JavaScriptObject array)
           
static String getArrayValue(JavaScriptObject array, int index)
           
static String getAttribute(JavaScriptObject elem, String attr)
           
static boolean getAttributeAsBoolean(JavaScriptObject elem, String attr)
          Returns attribute value set as a Boolean.
static Boolean getAttributeAsBoolean(JavaScriptObject elem, String attr, boolean allowNull)
          Returns attribute value set as a Boolean.
static Date getAttributeAsDate(JavaScriptObject elem, String attr)
           
static Double getAttributeAsDouble(JavaScriptObject elem, String attr)
           
static double[] getAttributeAsDoubleArray(JavaScriptObject elem, String attr)
           
static Element getAttributeAsElement(JavaScriptObject elem, String attr)
           
static Float getAttributeAsFloat(JavaScriptObject elem, String attr)
           
static Integer getAttributeAsInt(JavaScriptObject elem, String attr)
           
static int[] getAttributeAsIntArray(JavaScriptObject elem, String attr)
           
static JavaScriptObject getAttributeAsJavaScriptObject(JavaScriptObject elem, String attr)
           
static JavaScriptObject[] getAttributeAsJavaScriptObjectArray(JavaScriptObject elem, String attr)
           
static Map getAttributeAsMap(JavaScriptObject elem, String attr)
           
static Object getAttributeAsObject(JavaScriptObject elem, String attr)
           
static String[] getAttributeAsStringArray(JavaScriptObject elem, String attr)
           
static int[][] getCellArray(JavaScriptObject jsCells)
           
static String getClassName(JavaScriptObject javaScriptObject)
          Returns the javascript class name.
static Date getDateArrayValue(JavaScriptObject array, int i)
           
static double getdoubleArrayValue(JavaScriptObject array, int index)
           
static Double getDoubleArrayValue(JavaScriptObject array, int index)
           
static double getDoubleValueFromJavaScriptObjectArray(JavaScriptObject elem, int i)
           
static Element getElementValueFromJavaScriptObjectArray(JavaScriptObject elem, int i)
          This is used to access Element array as JavaScriptObject
static float getfloatArrayValue(JavaScriptObject array, int index)
           
static Float getFloatArrayValue(JavaScriptObject array, int index)
           
static int getIntArrayValue(JavaScriptObject array, int index)
           
static Integer getIntegerArrayValue(JavaScriptObject array, int index)
           
static int getIntValueFromJavaScriptObjectArray(JavaScriptObject elem, int i)
           
static int getJavaScriptObjectArraySize(JavaScriptObject elem)
           
static JsDate getJSLogicalDate(Date date)
           
static JsDate getJSLogicalDate(int year, int month, int date)
           
static JsDate getJSLogicalTime(Date date)
           
static JsDate getJSLogicalTime(int hour, int minute, int second, int millisecond)
           
static JavaScriptObject getJSOArrayValue(JavaScriptObject array, int index)
           
static Object getObjectArrayValue(JavaScriptObject array, int index)
           
static String[] getProperties(JavaScriptObject jsObj)
           
static String getPropertiesAsString(JavaScriptObject jsObj)
           
static String getStringValueFromJavaScriptObjectArray(JavaScriptObject elem, int i)
           
static JavaScriptObject getValueFromJavaScriptObjectArray(JavaScriptObject elem, int i)
           
static boolean isArray(JavaScriptObject jsObj)
           
static boolean isJavaBoolean(Object obj)
           
static boolean isJavaDate(Object obj)
           
static boolean isJavaDouble(Object obj)
           
static boolean isJavaFloat(Object obj)
           
static boolean isJavaInteger(Object obj)
           
static boolean isJavaList(Object obj)
           
static boolean isJavaMap(Object obj)
           
static boolean isJavaNumber(Object obj)
           
static boolean isJavaString(Object obj)
           
static boolean isJSO(Object object)
           
static boolean isScClassInstance(JavaScriptObject javaScriptObject)
          Returns whether the supplied JavaScriptObject is a SmartClient class instance.
static boolean isScClassObject(JavaScriptObject javaScriptObject)
          Returns whether the supplied JavaScriptObject is a SmartClient class (a Class object itself, rather than an instance of a class).
static JavaScriptObject[] listToArray(List list)
           
static void setArrayValue(JavaScriptObject array, int index, boolean value)
           
static void setArrayValue(JavaScriptObject array, int index, char value)
           
static void setArrayValue(JavaScriptObject array, int index, Date value)
           
static void setArrayValue(JavaScriptObject array, int index, double value)
           
static void setArrayValue(JavaScriptObject array, int index, JavaScriptObject value)
           
static void setArrayValue(JavaScriptObject array, int index, long value)
           
static void setArrayValue(JavaScriptObject array, int index, Object value)
           
static void setArrayValue(JavaScriptObject array, int index, String value)
           
static void setAttribute(JavaScriptObject elem, String attr, boolean value)
           
static void setAttribute(JavaScriptObject elem, String attr, Boolean value)
           
static void setAttribute(JavaScriptObject elem, String attr, Boolean[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, Date value)
           
static void setAttribute(JavaScriptObject elem, String attr, Date[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, double value)
           
static void setAttribute(JavaScriptObject elem, String attr, double[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, Double[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, float[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, Float[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, Function handler)
           
static void setAttribute(JavaScriptObject elem, String attr, int value)
           
static void setAttribute(JavaScriptObject elem, String attr, int[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, Integer[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, JavaScriptObject value)
           
static void setAttribute(JavaScriptObject elem, String attr, JavaScriptObject[] value)
           
static void setAttribute(JavaScriptObject elem, String attr, Long value)
           
static void setAttribute(JavaScriptObject elem, String attr, Long[] values)
           
static void setAttribute(JavaScriptObject jsObj, String attr, Map valueMap)
           
static void setAttribute(JavaScriptObject elem, String attr, Number value)
           
static void setAttribute(JavaScriptObject elem, String attr, Object value)
           
static void setAttribute(JavaScriptObject elem, String attr, String value)
           
static void setAttribute(JavaScriptObject elem, String attr, String[] values)
           
static void setAttribute(JavaScriptObject elem, String attr, ValueEnum[] values)
           
static void setNullAttribute(JavaScriptObject elem, String attr)
           
static void setObjectAttribute(JavaScriptObject elem, String attr, Object object)
           
static void throwUnconvertibleObjectException(Object object, String messageDetail)
           
static JavaScriptObject[] toArray(JavaScriptObject array)
           
static Boolean toBoolean(boolean value)
           
static Date toDate(double millis)
          Converts a time to a Java Date object.
static JavaScriptObject toDateJS(Date date)
           
static Double toDouble(double value)
           
static Element[] toElementArray(JavaScriptObject array)
           
static Float toFloat(float value)
           
static Integer toInteger(int value)
           
static Long toLong(double value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClassName

public static String getClassName(JavaScriptObject javaScriptObject)
Returns the javascript class name.

Returns:

isScClassInstance

public static boolean isScClassInstance(JavaScriptObject javaScriptObject)
Returns whether the supplied JavaScriptObject is a SmartClient class instance.

Parameters:
the - object to evaluate
Returns:
whether object is an instance

isScClassObject

public static boolean isScClassObject(JavaScriptObject javaScriptObject)
Returns whether the supplied JavaScriptObject is a SmartClient class (a Class object itself, rather than an instance of a class).

Parameters:
the - object to evaluate
Returns:
whether object is a Class object

eval

public static JavaScriptObject eval(String jsFrag)
Evaluate the passed string as Javascript

Parameters:
jsFrag - the string to evaluate
Returns:
the JavaScriptObject upon evaluation

isJSO

public static boolean isJSO(Object object)

doubleValue

public static double doubleValue(Number num)

getAttribute

public static String getAttribute(JavaScriptObject elem,
                                  String attr)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                String value)

getAttributeAsJavaScriptObject

public static JavaScriptObject getAttributeAsJavaScriptObject(JavaScriptObject elem,
                                                              String attr)

getAttributeAsJavaScriptObjectArray

public static JavaScriptObject[] getAttributeAsJavaScriptObjectArray(JavaScriptObject elem,
                                                                     String attr)

toArray

public static JavaScriptObject[] toArray(JavaScriptObject array)

isArray

public static boolean isArray(JavaScriptObject jsObj)

toElementArray

public static Element[] toElementArray(JavaScriptObject array)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                JavaScriptObject[] value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                int[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                float[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                double[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                String[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Integer[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Float[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Boolean[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Double[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Long[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Date[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                ValueEnum[] values)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Object value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                JavaScriptObject value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                int value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Number value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Long value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Boolean value)

setNullAttribute

public static void setNullAttribute(JavaScriptObject elem,
                                    String attr)

deleteAttribute

public static void deleteAttribute(JavaScriptObject elem,
                                   String attr)

deleteAttributeIfExists

public static void deleteAttributeIfExists(JavaScriptObject elem,
                                           String attr)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                boolean value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                double value)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Function handler)

setAttribute

public static void setAttribute(JavaScriptObject elem,
                                String attr,
                                Date value)

setObjectAttribute

public static void setObjectAttribute(JavaScriptObject elem,
                                      String attr,
                                      Object object)

getAttributeAsElement

public static Element getAttributeAsElement(JavaScriptObject elem,
                                            String attr)

getAttributeAsInt

public static Integer getAttributeAsInt(JavaScriptObject elem,
                                        String attr)

getAttributeAsDouble

public static Double getAttributeAsDouble(JavaScriptObject elem,
                                          String attr)

getAttributeAsDate

public static Date getAttributeAsDate(JavaScriptObject elem,
                                      String attr)

getAttributeAsFloat

public static Float getAttributeAsFloat(JavaScriptObject elem,
                                        String attr)

getAttributeAsIntArray

public static int[] getAttributeAsIntArray(JavaScriptObject elem,
                                           String attr)

getAttributeAsDoubleArray

public static double[] getAttributeAsDoubleArray(JavaScriptObject elem,
                                                 String attr)

getAttributeAsStringArray

public static String[] getAttributeAsStringArray(JavaScriptObject elem,
                                                 String attr)

getJavaScriptObjectArraySize

public static int getJavaScriptObjectArraySize(JavaScriptObject elem)

getIntValueFromJavaScriptObjectArray

public static int getIntValueFromJavaScriptObjectArray(JavaScriptObject elem,
                                                       int i)

getDoubleValueFromJavaScriptObjectArray

public static double getDoubleValueFromJavaScriptObjectArray(JavaScriptObject elem,
                                                             int i)

getStringValueFromJavaScriptObjectArray

public static String getStringValueFromJavaScriptObjectArray(JavaScriptObject elem,
                                                             int i)

getValueFromJavaScriptObjectArray

public static JavaScriptObject getValueFromJavaScriptObjectArray(JavaScriptObject elem,
                                                                 int i)

getCellArray

public static int[][] getCellArray(JavaScriptObject jsCells)

convertToCellArray

public static JavaScriptObject convertToCellArray(int[][] cells)

getAttributeAsBoolean

public static boolean getAttributeAsBoolean(JavaScriptObject elem,
                                            String attr)
Returns attribute value set as a Boolean. For convenience in checking boolean properties, 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.

Parameters:
elem - the JavaScriptObject containing the property
attr - the property name
Returns:
the property value

getAttributeAsBoolean

public static Boolean getAttributeAsBoolean(JavaScriptObject elem,
                                            String attr,
                                            boolean allowNull)
Returns attribute value set as a Boolean. If the attribute value is 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).

Parameters:
elem - the JavaScriptObject containing the property
attr - the property name
allowNull - whether to permit a null return value
Returns:
the property value

getAttributeAsObject

public static Object getAttributeAsObject(JavaScriptObject elem,
                                          String attr)

getAttributeAsMap

public static Map getAttributeAsMap(JavaScriptObject elem,
                                    String attr)

listToArray

public static JavaScriptObject[] listToArray(List list)

arrayConvert

public static JavaScriptObject arrayConvert(Object[] array)

arrayConvert

public static JavaScriptObject arrayConvert(JavaScriptObject[] array)

arrayLength

public static int arrayLength(JavaScriptObject array)

arrayGetObject

public static Object arrayGetObject(JavaScriptObject array,
                                    int index)

arraySet

public static void arraySet(JavaScriptObject array,
                            int index,
                            Object value)

arraySet

public static void arraySet(JavaScriptObject array,
                            int index,
                            JavaScriptObject value)

getElementValueFromJavaScriptObjectArray

public static Element getElementValueFromJavaScriptObjectArray(JavaScriptObject elem,
                                                               int i)
This is used to access Element array as JavaScriptObject


createObject

public static JavaScriptObject createObject()

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(boolean[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(char[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(byte[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(short[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(int[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(float[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(double[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(long[] array)

convertToJava

public static Object convertToJava(JavaScriptObject object,
                                   boolean listAsArray)
Convert a JavaScriptObject to the appropriate type of JavaObject. Simple JavaScript objects (key:value pairs) will be converted to Map instances. JavaScript Arrays will be returned as a List or an Object Array depending on the listAsArray parameter Conversion is recursive, nested JavaScript objects and arrays will have their members converted as well JavaScript dates will be returned as Java Dates Simple Javascript types such as integers, floats and strings will be returned as the equivalent java object class (String, Integer, etc)

Parameters:
object - JavaScriptObject to convert
listAsArray - Should arrays be converted to Object[] or List
Returns:
converted Java object. May be a Map, a List or an Object[] depending on the underlying JS type.

convertToJava

public static Object convertToJava(JavaScriptObject object)

convertToMap

public static Map convertToMap(JavaScriptObject jsObj,
                               boolean listAsArray)
Convert a Javascript object containing key:value pairs to a Map.

Parameters:
jsObj - the javascript object
listAsArray - Should arrays be converted to Object[] or List
Returns:
the map
Throws:
IllegalArgumentException - if unable to convert the passed JavaScript object to a map

convertToMap

public static Map convertToMap(JavaScriptObject jsObj)
Convert a Javascript object containing key:value pairs to a Map.

Parameters:
jsObj - the javascript object
Returns:
the map
Throws:
IllegalArgumentException - if unable to convert pass JavaScript object to a map

convertToArray

public static Object[] convertToArray(JavaScriptObject object)
Convert a Javascript object to an Object[]. If the Javascript object is not an array in Javascript, a new array will be created containing the converted object as the only entry.

Parameters:
object -
Returns:

convertToList

public static List convertToList(JavaScriptObject object)
Convert a Javascript object to a List. If the Javascript object is not an array in Javascript, a new List will be created containing the converted object as the only entry.

Parameters:
object -
Returns:

convertToJavaScriptDate

public static JsDate convertToJavaScriptDate(Date date)

convertToJavaDate

public static Date convertToJavaDate(JavaScriptObject val)

convertToString

public static String convertToString(Object obj)

isJavaDate

public static boolean isJavaDate(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Date

isJavaNumber

public static boolean isJavaNumber(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Number

isJavaInteger

public static boolean isJavaInteger(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Integer

isJavaFloat

public static boolean isJavaFloat(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Float

isJavaDouble

public static boolean isJavaDouble(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Double

isJavaString

public static boolean isJavaString(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java String

isJavaBoolean

public static boolean isJavaBoolean(Object obj)
Parameters:
obj - the object
Returns:
true if object is a Java Integer

isJavaList

public static boolean isJavaList(Object obj)

isJavaMap

public static boolean isJavaMap(Object obj)

convertToJsArray

public static <O extends JavaScriptObject> JsArray<O> convertToJsArray(O[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(Object[] array)

convertToJavaScriptArray

public static JavaScriptObject convertToJavaScriptArray(Object[] array,
                                                        boolean strict)

throwUnconvertibleObjectException

public static void throwUnconvertibleObjectException(Object object,
                                                     String messageDetail)

toInteger

public static Integer toInteger(int value)

toLong

public static Long toLong(double value)

toFloat

public static Float toFloat(float value)

toDouble

public static Double toDouble(double value)

toDate

public static Date toDate(double millis)
Converts a time to a Java 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.

Parameters:
millis - number of milliseconds since January 1, 1970, 00:00:00 GMT.
Returns:
a new Date representing the given time.

toDateJS

public static JavaScriptObject toDateJS(Date date)

getJSLogicalDate

public static JsDate getJSLogicalDate(Date date)

getJSLogicalDate

public static JsDate getJSLogicalDate(int year,
                                      int month,
                                      int date)

getJSLogicalTime

public static JsDate getJSLogicalTime(Date date)

getJSLogicalTime

public static JsDate getJSLogicalTime(int hour,
                                      int minute,
                                      int second,
                                      int millisecond)

toBoolean

public static Boolean toBoolean(boolean value)

createJavaScriptArray

public static JavaScriptObject createJavaScriptArray()

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 Date value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 String value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 double value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 long value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 boolean value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 char value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 JavaScriptObject value)

setArrayValue

public static void setArrayValue(JavaScriptObject array,
                                 int index,
                                 Object value)

getArrayValue

public static String getArrayValue(JavaScriptObject array,
                                   int index)

getJSOArrayValue

public static JavaScriptObject getJSOArrayValue(JavaScriptObject array,
                                                int index)

getObjectArrayValue

public static Object getObjectArrayValue(JavaScriptObject array,
                                         int index)

getIntArrayValue

public static int getIntArrayValue(JavaScriptObject array,
                                   int index)

getfloatArrayValue

public static float getfloatArrayValue(JavaScriptObject array,
                                       int index)

getdoubleArrayValue

public static double getdoubleArrayValue(JavaScriptObject array,
                                         int index)

getIntegerArrayValue

public static Integer getIntegerArrayValue(JavaScriptObject array,
                                           int index)

getFloatArrayValue

public static Float getFloatArrayValue(JavaScriptObject array,
                                       int index)

getDoubleArrayValue

public static Double getDoubleArrayValue(JavaScriptObject array,
                                         int index)

getDateArrayValue

public static Date getDateArrayValue(JavaScriptObject array,
                                     int i)

getArrayLength

public static int getArrayLength(JavaScriptObject array)

convertToJavaIntArray

public static int[] convertToJavaIntArray(JavaScriptObject array)

convertToJavaInterArray

public static Integer[] convertToJavaInterArray(JavaScriptObject array)

convertToJavaStringArray

public static String[] convertToJavaStringArray(JavaScriptObject array)

convertToJavaFloatArray

public static Float[] convertToJavaFloatArray(JavaScriptObject array)

convertToJavaDoubleArray

public static Double[] convertToJavaDoubleArray(JavaScriptObject array)

convertToJavaDateArray

public static Date[] convertToJavaDateArray(JavaScriptObject array)

convertToJavaObjectArray

public static Object[] convertToJavaObjectArray(JavaScriptObject array)

convertToJavaRefDataClassArray

public static RefDataClass[] convertToJavaRefDataClassArray(JavaScriptObject nativeArray)

apply

public static void apply(JavaScriptObject config,
                         JavaScriptObject jsObj)

setAttribute

public static void setAttribute(JavaScriptObject jsObj,
                                String attr,
                                Map valueMap)

convertMapToJavascriptObject

public static JavaScriptObject convertMapToJavascriptObject(Map valueMap)

convertMapToJavascriptObject

public static JavaScriptObject convertMapToJavascriptObject(Map valueMap,
                                                            boolean strict)

getProperties

public static String[] getProperties(JavaScriptObject jsObj)

getPropertiesAsString

public static String getPropertiesAsString(JavaScriptObject jsObj)

addProperties

public static void addProperties(JavaScriptObject destination,
                                 JavaScriptObject propertiesObject)
Adds all properties and methods from the propertiesObject to the destination object.

Parameters:
destination - the destination object
propertiesObject - the propertiesObject

cleanProperties

public static JavaScriptObject cleanProperties(JavaScriptObject properties,
                                               boolean copyProperties)
Removes non-transferable properties from the supplied object (e.g. widget ID), performing a copy first if requested.

Parameters:
properties - the supplied object to clean
copyProperties - whether to copy the object first
Returns:
the cleaned properties object