com.smartgwt.client.core
Class DataClass

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
Direct Known Subclasses:
AnimateShowEffect, Criteria, DataSourceField, DetailViewerField, DrawnValue, DrawShapeCommand, DSRequestModifier, FacetValueMap, FormItemEventInfo, FormItemIcon, Gradient, GroupNode, HeaderSpan, ImgProperties, KeyIdentifier, ListGridField, ListProperties, MetricSettings, OperationBinding, PortalPosition, PrintProperties, RefDataClass, RelativeDate, RPCRequest, RPCResponse, SerializationContext, ServerObject, Shadow, SortSpecifier, StretchItem, UserFormula, UserSummary, Validator, XmlNamespaces

public class DataClass
extends JsObject


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
DataClass()
           
DataClass(JavaScriptObject jsObj)
           
 
Method Summary
protected
<H extends EventHandler>
HandlerRegistration
doAddHandler(H handler, GwtEvent.Type<H> type)
           
 void fireEvent(GwtEvent<?> event)
           
 String getAttribute(String property)
          Returns attribute value as a String
 Boolean getAttributeAsBoolean(String property)
          Returns attribute value set as a Boolean.
 Date getAttributeAsDate(String property)
          Returns attribute value as a Date.
 Double getAttributeAsDouble(String property)
          Returns attribute as a Double.
 double[] getAttributeAsDoubleArray(String property)
          Returns attribute as a double array.
 Float getAttributeAsFloat(String property)
          Returns attribute value as a Float.
 Integer getAttributeAsInt(String property)
          Returns attribute value as an Integer.
 int[] getAttributeAsIntArray(String property)
          Returns attribute as an int array.
 JavaScriptObject getAttributeAsJavaScriptObject(String property)
          Returns attribute value as a JavaScript Object.
 Long getAttributeAsLong(String property)
          Returns attribute as a Long.
 Map getAttributeAsMap(String property)
          Returns attribute value as a Map.
 Object getAttributeAsObject(String property)
          Returns attribute value as a Java Object.
 Record getAttributeAsRecord(String property)
          Get the attribute value as a Record.
 String getAttributeAsString(String property)
          Returns attribute value as a String.
 String[] getAttributeAsStringArray(String property)
          Returns attribute as a String array.
 String[] getAttributes()
           
 int getHandlerCount(GwtEvent.Type<?> type)
           
 void setAttribute(String property, BaseClass value)
          Set attribute value to a BaseClass.
 void setAttribute(String property, BaseClass[] value)
          Set attribute value to a BaseClass array.
 void setAttribute(String property, BaseWidget[] value)
          Set attribute value to a BaseWidget array.
 void setAttribute(String property, boolean value)
          Set attribute value to a boolean.
 void setAttribute(String property, Boolean value)
          Set attribute value to a Boolean.
 void setAttribute(String property, DataClass value)
          Set attribute value to a DataClass.
 void setAttribute(String property, DataClass[] value)
          Set attribute value to a DataClass array.
 void setAttribute(String property, Date value)
          Set attribute value to a Date.
 void setAttribute(String property, double value)
          Set attribute value to a double.
 void setAttribute(String property, Double value)
          Set attribute value to a Double.
 void setAttribute(String property, double[] value)
          Set attribute value to a double array.
 void setAttribute(String property, Float value)
          Set attribute value to a Float.
 void setAttribute(String property, int value)
          Set attribute value to an int.
 void setAttribute(String property, int[] value)
          Set attribute value to an int array.
 void setAttribute(String property, Integer value)
          Set attribute value to an Integer.
 void setAttribute(String property, Integer[] value)
          Set attribute value to an Integer array.
 void setAttribute(String property, JavaScriptObject value)
          Set attribute value to a JavaScriptObject.
 void setAttribute(String property, long value)
          Set attribute value to a long.
 void setAttribute(String property, Map value)
          Set attribute value to a Map.
 void setAttribute(String property, Object value)
          Set the attribute value to an Object.
 void setAttribute(String property, String value)
          Set attribute value to a String
 void setAttribute(String property, String[] value)
          Set attribute value to a String array.
 void setAttribute(String property, ValueEnum value)
          Set attribute value to a ValueEnum.
 void setAttribute(String property, ValueEnum[] value)
          Set attribute value to a ValueEnum array.
 void setAttributeAsJavaObject(String property, Object value)
          Set the attribute value to an Object.
 
Methods inherited from class com.smartgwt.client.core.JsObject
equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataClass

public DataClass()

DataClass

public DataClass(JavaScriptObject jsObj)
Method Detail

setAttribute

public void setAttribute(String property,
                         String value)
Set attribute value to a String

Parameters:
property -
value -

getAttribute

public String getAttribute(String property)
Returns attribute value as a String

Parameters:
property -
Returns:

getAttributeAsString

public String getAttributeAsString(String property)
Returns attribute value as a String.

Parameters:
property -
Returns:

setAttribute

public void setAttribute(String property,
                         int value)
Set attribute value to an int. Value will be stored as a JavaScript Number on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         double value)
Set attribute value to a double. Value will be stored as a JavaScript Number on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         long value)
Set attribute value to a long. Value will be stored as a JavaScript Number on the underlying data object.

Parameters:
property -
value -

getAttributeAsInt

public Integer getAttributeAsInt(String property)
Returns attribute value as an Integer. Applies to values stored as a JavaScript number on the underlying data object.

Parameters:
property -
Returns:

setAttribute

public void setAttribute(String property,
                         boolean value)
Set attribute value to a boolean.

Parameters:
property -
value -

getAttributeAsBoolean

public Boolean getAttributeAsBoolean(String property)
Returns attribute value set as a Boolean.

Parameters:
property -
Returns:

getAttributeAsDouble

public Double getAttributeAsDouble(String property)
Returns attribute as a Double. Applies to values stored as a JavaScript Number on the underlying data object.

Parameters:
property -
Returns:

getAttributeAsLong

public Long getAttributeAsLong(String property)
Returns attribute as a Long. Applies to values stored as a JavaScript Number on the underlying data object.

Parameters:
property -
Returns:

getAttributeAsDoubleArray

public double[] getAttributeAsDoubleArray(String property)
Returns attribute as a double array. Applies to values stored as a JavaScript Array of Numbers on the underlying data object.

Parameters:
property -
Returns:

setAttribute

public void setAttribute(String property,
                         int[] value)
Set attribute value to an int array. Value will be stored as a JavaScript Array of Numbers on the underlying data object.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Integer[] value)
Set attribute value to an Integer array. Value will be stored as a JavaScript Array of Numbers on the underlying data object.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         DataClass[] value)
Set attribute value to a DataClass array. Value will be stored as a JavaScript Array of the underlying JavaScript objects for each entry.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         BaseClass[] value)
Set attribute value to a BaseClass array. Value will be stored as a JavaScript Array of the underlying JavaScript objects for each entry.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         BaseWidget[] value)
Set attribute value to a BaseWidget array. Value will be stored as a JavaScript Array of the underlying JavaScript objects for each entry.

Parameters:
property -
value -

getAttributeAsIntArray

public int[] getAttributeAsIntArray(String property)
Returns attribute as an int array. Applies to values stored as a JavaScript Array of Numbers on the underlying data object.

Parameters:
property -
Returns:

setAttribute

public void setAttribute(String property,
                         String[] value)
Set attribute value to a String array. Value will be stored as a JavaScript Array of Strings on the underlying data object.

Parameters:
property -
value -

getAttributeAsStringArray

public String[] getAttributeAsStringArray(String property)
Returns attribute as a String array. Applies to values stored as a JavaScript Array of Strings on the underlying data object.

Parameters:
property -
Returns:

setAttribute

public void setAttribute(String property,
                         DataClass value)
Set attribute value to a DataClass. Value will be stored as the underlying JavaScript object for the DataClass instance passed in.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         BaseClass value)
Set attribute value to a BaseClass. Value will be stored as the underlying JavaScript object for the BaseClass instance passed in.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         JavaScriptObject value)
Set attribute value to a JavaScriptObject.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Date value)
Set attribute value to a Date. Value will be stored as a JavaScript Date on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         double[] value)
Set attribute value to a double array. Value will be stored as a JavaScript Array of Numbers on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Boolean value)
Set attribute value to a Boolean.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Map value)
Set attribute value to a Map. Value will be stored as a JavaScript Object on the underlying data object, with property/value pairs matching the keys/values specified on the Map. Note that this is a recursive conversion - each value will also be converted to the equivalent JavaScript type where appropriate.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         ValueEnum[] value)
Set attribute value to a ValueEnum array. Value will be stored as a JavaScript Array containing the each Enum value.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         ValueEnum value)
Set attribute value to a ValueEnum. The value of the ValueEnum will be stored on the underlying data object.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Object value)
Set the attribute value to an Object.

The values provided as attributes are generally expected to contain valid values for a field of a DataBoundComponent. Therefore this method converts the value passed in to an equivalent object in JavaScript before storing on underlying data object.
Developers can use setAttributeAsJavaObject(String, Object) to store Java objects without converting to JavaScript.

Conversions that occur include:

Other Java Objects, including POJOs are stored on the underlying data object unconverted. Developers can retrieve such values via getAttributeAsObject(String).

Parameters:
property - the attribute name
value - the attribute value.

setAttributeAsJavaObject

public void setAttributeAsJavaObject(String property,
                                     Object value)
Set the attribute value to an Object.

Unlike setAttribute(String, Object), this method will store the value passed in as-is rather than converting to an equivalent object in JavaScript.

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Double value)
Set attribute value to a Double. Value will be stored as a JavaScript Number on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Integer value)
Set attribute value to an Integer. Value will be stored as a JavaScript Number on the underlying data object

Parameters:
property -
value -

setAttribute

public void setAttribute(String property,
                         Float value)
Set attribute value to a Float. Value will be stored as a JavaScript Number on the underlying data object

Parameters:
property -
value -

getAttributeAsFloat

public Float getAttributeAsFloat(String property)
Returns attribute value as a Float. Applies to values stored as a JavaScript number on the underlying data object.

Parameters:
property -
Returns:

getAttributeAsDate

public Date getAttributeAsDate(String property)
Returns attribute value as a Date. Applies to values stored as a JavaScript Date on the underlying data object.

Parameters:
property -
Returns:

getAttributeAsObject

public Object getAttributeAsObject(String property)
Returns attribute value as a Java Object.

If the attribute has been set as a Java Object (typically via a call to setAttributeAsJavaObject(String, Object)) it will be returned as is.

Values specified as JavaScript types will be converted to the equivalent Java type if possible.

Parameters:
property -
Returns:

getAttributeAsMap

public Map getAttributeAsMap(String property)
Returns attribute value as a Map. Applies to values stored as a JavaScript Object on the underlying data object.

Parameters:
property -
Returns:

getAttributeAsRecord

public Record getAttributeAsRecord(String property)
Get the attribute value as a Record.

Parameters:
property - the property name
Returns:
the record value

getAttributeAsJavaScriptObject

public JavaScriptObject getAttributeAsJavaScriptObject(String property)
Returns attribute value as a JavaScript Object.

Parameters:
property -
Returns:

getAttributes

public String[] getAttributes()

fireEvent

public void fireEvent(GwtEvent<?> event)

doAddHandler

protected final <H extends EventHandler> HandlerRegistration doAddHandler(H handler,
                                                                          GwtEvent.Type<H> type)

getHandlerCount

public int getHandlerCount(GwtEvent.Type<?> type)