com.smartgwt.client.core

## Class DataClass

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass

- Direct Known Subclasses:
    AnimateShowEffect, Criteria, DataSourceField, DetailViewerField, DrawnValue, DrawShapeCommand, FacetValueMap, FileSpec, FormItemEventInfo, FormItemIcon, Gradient, GroupNode, HeaderSpan, ImgProperties, KeyIdentifier, ListProperties, MetricSettings, OperationBinding, PortalPosition, PrintProperties, RefDataClass, RelativeDate, RPCRequest, RPCResponse, SerializationContext, SerializationSettings, Shadow, SortSpecifier, StretchItem, UserFormula, UserSummary, Validator, XmlNamespaces

      public class DataClass
      extends JsObject

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `factoryCreated`
    `protected java.util.Map<java.lang.String,java.lang.Object>` | `factoryProperties`

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataClass()`
    `DataClass(JavaScriptObject jsObj)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `applyFactoryProperties()`
    `protected <H extends EventHandler> HandlerRegistration` | `doAddHandler(H handler, GwtEvent.Type<H> type)`
    `void` | `fireEvent(GwtEvent<?> event)`
    `java.lang.String` | `getAttribute(java.lang.String property)` Returns attribute value as a String
    `java.lang.Boolean` | `getAttributeAsBoolean(java.lang.String property)` Returns attribute value set as a Boolean.
    `java.lang.Boolean` | `getAttributeAsBoolean(java.lang.String property, boolean allowNull)` Returns attribute value set as a Boolean.
    `java.util.Date` | `getAttributeAsDate(java.lang.String property)` Returns attribute value as a Date.
    `java.lang.Double` | `getAttributeAsDouble(java.lang.String property)` Returns attribute as a Double.
    `double[]` | `getAttributeAsDoubleArray(java.lang.String property)` Returns attribute as a double array.
    `java.lang.Float` | `getAttributeAsFloat(java.lang.String property)` Returns attribute value as a Float.
    `java.lang.Integer` | `getAttributeAsInt(java.lang.String property)` Returns attribute value as an Integer.
    `int[]` | `getAttributeAsIntArray(java.lang.String property)` Returns attribute as an int array.
    `JavaScriptObject` | `getAttributeAsJavaScriptObject(java.lang.String property)` Returns attribute value as a JavaScript Object.
    `java.lang.Long` | `getAttributeAsLong(java.lang.String property)` Returns attribute as a Long.
    `java.util.Map` | `getAttributeAsMap(java.lang.String property)` Returns attribute value as a Map.
    `java.lang.Object` | `getAttributeAsObject(java.lang.String property)` Returns attribute value as a Java Object.
    `Record` | `getAttributeAsRecord(java.lang.String property)` Get the attribute value as a Record.
    `java.lang.String` | `getAttributeAsString(java.lang.String property)` Returns attribute value as a String.
    `java.lang.String[]` | `getAttributeAsStringArray(java.lang.String property)` Returns attribute as a String array.
    `java.lang.String[]` | `getAttributes()`
    `int` | `getHandlerCount(GwtEvent.Type<?> type)`
    `boolean` | `isFactoryCreated()`
    `void` | `setAttribute(java.lang.String property, BaseClass value)` Set attribute value to a BaseClass.
    `void` | `setAttribute(java.lang.String property, BaseClass[] value)` Set attribute value to a BaseClass array.
    `void` | `setAttribute(java.lang.String property, BaseWidget[] value)` Set attribute value to a BaseWidget array.
    `void` | `setAttribute(java.lang.String property, boolean value)` Set attribute value to a boolean.
    `void` | `setAttribute(java.lang.String property, java.lang.Boolean value)` Set attribute value to a Boolean.
    `void` | `setAttribute(java.lang.String property, DataClass value)` Set attribute value to a DataClass.
    `void` | `setAttribute(java.lang.String property, DataClass[] value)` Set attribute value to a DataClass array.
    `void` | `setAttribute(java.lang.String property, java.util.Date value)` Set attribute value to a Date.
    `void` | `setAttribute(java.lang.String property, double value)` Set attribute value to a double.
    `void` | `setAttribute(java.lang.String property, java.lang.Double value)` Set attribute value to a Double.
    `void` | `setAttribute(java.lang.String property, double[] value)` Set attribute value to a double array.
    `void` | `setAttribute(java.lang.String property, java.lang.Float value)` Set attribute value to a Float.
    `void` | `setAttribute(java.lang.String property, int value)` Set attribute value to an int.
    `void` | `setAttribute(java.lang.String property, int[] value)` Set attribute value to an int array.
    `void` | `setAttribute(java.lang.String property, java.lang.Integer value)` Set attribute value to an Integer.
    `void` | `setAttribute(java.lang.String property, java.lang.Integer[] value)` Set attribute value to an Integer array.
    `void` | `setAttribute(java.lang.String property, JavaScriptObject value)` Set attribute value to a JavaScriptObject.
    `void` | `setAttribute(java.lang.String property, long value)` Set attribute value to a long.
    `void` | `setAttribute(java.lang.String property, java.util.Map value)` Set attribute value to a Map.
    `void` | `setAttribute(java.lang.String property, java.lang.Object value)` Set the attribute value to an Object.
    `void` | `setAttribute(java.lang.String property, java.lang.String value)` Set attribute value to a String
    `void` | `setAttribute(java.lang.String property, java.lang.String[] value)` Set attribute value to a String array.
    `void` | `setAttribute(java.lang.String property, ValueEnum value)` Set attribute value to a ValueEnum.
    `void` | `setAttribute(java.lang.String property, ValueEnum[] value)` Set attribute value to a ValueEnum array.
    `void` | `setAttributeAsJavaObject(java.lang.String property, java.lang.Object value)` Set the attribute value to an Object.
    `void` | `setFactoryCreated(boolean createdByBeanFactory)`

    - ### 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`

- - ### Field Detail

    - #### factoryProperties

          protected java.util.Map<java.lang.String,java.lang.Object> factoryProperties

    - #### factoryCreated

          protected boolean factoryCreated

  - ### Constructor Detail

    - #### DataClass

          public DataClass()

    - #### DataClass

          public DataClass(JavaScriptObject jsObj)

  - ### Method Detail

    - #### applyFactoryProperties

          public void applyFactoryProperties()

    - #### setFactoryCreated

          public void setFactoryCreated(boolean createdByBeanFactory)

    - #### isFactoryCreated

          public boolean isFactoryCreated()

    - #### setAttribute

          public void setAttribute(java.lang.String property,
                          java.lang.String value)

      Set attribute value to a String
      Parameters:
        `property` -
        `value` -

    - #### getAttribute

          public java.lang.String getAttribute(java.lang.String property)

      Returns attribute value as a String
      Parameters:
        `property` -
      Returns:

    - #### getAttributeAsString

          public java.lang.String getAttributeAsString(java.lang.String property)

      Returns attribute value as a String.
      Parameters:
        `property` -
      Returns:

    - #### getAttributeAsInt

          public java.lang.Integer getAttributeAsInt(java.lang.String property)

      Returns attribute value as an Integer. Applies to values stored as a JavaScript number on the underlying data object.
      Parameters:
        `property` -
      Returns:

    - #### getAttributeAsBoolean

          public java.lang.Boolean getAttributeAsBoolean(java.lang.String property)

      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 two parameter variant of this API `getAttributeAsBoolean(String, boolean)` if you want `null` returned for `null` attribute values.
      Parameters:
        `property` - the property name
      Returns:
        the property value

    - #### getAttributeAsBoolean

          public java.lang.Boolean getAttributeAsBoolean(java.lang.String property,
                                                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 one parameter variant of this API `getAttributeAsBoolean(String)`.
      Parameters:
        `property` - the property name
        `allowNull` - whether to allow null
      Returns:
        the property value

    - #### getAttributeAsDouble

          public java.lang.Double getAttributeAsDouble(java.lang.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 java.lang.Long getAttributeAsLong(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String property,
                          java.lang.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 java.lang.String[] getAttributeAsStringArray(java.lang.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(java.lang.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(java.lang.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(java.lang.String property,
                          JavaScriptObject value)

      Set attribute value to a JavaScriptObject.
      Parameters:
        `property` -
        `value` -

    - #### setAttribute

          public void setAttribute(java.lang.String property,
                          java.util.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(java.lang.String property,
                          java.util.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(java.lang.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(java.lang.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(java.lang.String property,
                          java.lang.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:

      - Numeric data types will be represented as JavaScript Number
      - Dates (and subclasses) will be stored as JavaScript Date
      - Java Arrays will be stored as JavaScript Array, with members converted to the equivalent JavaScript type where appropriate
      - Java Collections (including List, Set) will be stored as JavaScript Array, with members converted to the equivalent JavaScript object (recursively) where appropriate
      - Maps are stored as JavaScript Objects with each key mapped to a property on the object. Property values are converted to the equivalent JavaScript object (recursively) where appropriate
      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(java.lang.String property,
                                      java.lang.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(java.lang.String property,
                          boolean value)

      Set attribute value to a boolean.
      Parameters:
        `property` -
        `value` -

    - #### setAttribute

          public void setAttribute(java.lang.String property,
                          java.lang.Boolean value)

      Set attribute value to a Boolean.
      Parameters:
        `property` -
        `value` -

    - #### setAttribute

          public void setAttribute(java.lang.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(java.lang.String property,
                          java.lang.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(java.lang.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` -

    - #### setAttribute

          public void setAttribute(java.lang.String property,
                          java.lang.Float value)

      Set attribute value to a Float. Value will be stored as a JavaScript Number on the underlying data object
      Parameters:
        `property` -
        `value` -

    - #### setAttribute

          public void setAttribute(java.lang.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(java.lang.String property,
                          java.lang.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(java.lang.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(java.lang.String property,
                          java.lang.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(java.lang.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` -

    - #### getAttributeAsFloat

          public java.lang.Float getAttributeAsFloat(java.lang.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 java.util.Date getAttributeAsDate(java.lang.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 java.lang.Object getAttributeAsObject(java.lang.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 java.util.Map getAttributeAsMap(java.lang.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(java.lang.String property)

      Get the attribute value as a Record.
      Parameters:
        `property` - the property name
      Returns:
        the record value

    - #### getAttributeAsJavaScriptObject

          public JavaScriptObject getAttributeAsJavaScriptObject(java.lang.String property)

      Returns attribute value as a JavaScript Object.
      Parameters:
        `property` -
      Returns:

    - #### getAttributes

          public java.lang.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)