com.extjs.gxt.ui.client.data
Class DataField

java.lang.Object
  extended by com.extjs.gxt.ui.client.data.DataField

public class DataField
extends java.lang.Object

Describes a field in a Model. Used when mapping raw data to a model's properties.


Field Summary
static java.lang.String DATE_TYPE
          Field type constant for dates.
 
Constructor Summary
DataField(java.lang.String name)
          Creates a new field.
DataField(java.lang.String name, java.lang.String map)
          Creates a new field instance.
 
Method Summary
 java.lang.String getFormat()
          Returns the format used when the type has been set to java.util.Date.
 java.lang.String getMap()
          Returns the map.
 java.lang.String getName()
          Returns the name.
 java.lang.Class<?> getType()
          Returns the type.
 void setFormat(java.lang.String format)
          Format is used when converting raw data to object instances.
 void setMap(java.lang.String map)
          An optional field used when the property name of the model is different than the property name of the raw data.
 void setName(java.lang.String name)
          Sets the name of the field.
 void setType(java.lang.Class<?> type)
          The data type of the field used when converting the raw value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_TYPE

public static final java.lang.String DATE_TYPE
Field type constant for dates.

See Also:
Constant Field Values
Constructor Detail

DataField

public DataField(java.lang.String name)
Creates a new field.

Parameters:
name - the name

DataField

public DataField(java.lang.String name,
                 java.lang.String map)
Creates a new field instance.

Parameters:
name - the field name
map - the map name
Method Detail

getFormat

public java.lang.String getFormat()
Returns the format used when the type has been set to java.util.Date.

Returns:
the format

getMap

public java.lang.String getMap()
Returns the map.

Returns:
the map

getName

public java.lang.String getName()
Returns the name.

Returns:
the name

getType

public java.lang.Class<?> getType()
Returns the type.

Returns:
the type

setFormat

public void setFormat(java.lang.String format)
Format is used when converting raw data to object instances. Format only applies when #setType is used with java.util.Date. The value is a date time format as defined by @link DateTimeFormat. If the raw data is a timestamp, the format should be set to "timestamp".

Parameters:
format - the format

setMap

public void setMap(java.lang.String map)
An optional field used when the property name of the model is different than the property name of the raw data. When used with a XmlReader the map value is treated as a xpath selector.

Parameters:
map - the map

setName

public void setName(java.lang.String name)
Sets the name of the field.

Parameters:
name - the field

setType

public void setType(java.lang.Class<?> type)
The data type of the field used when converting the raw value.

Valid values:

Parameters:
type -