com.dhtmlx.connector
Class DataItem

java.lang.Object
  extended by com.dhtmlx.connector.DataItem
Direct Known Subclasses:
ComboDataItem, GridDataItem, SchedulerDataItem, TreeDataItem

public class DataItem
extends java.lang.Object

The Class DataItem. Wrapper around the fetched data. Controls how the data transforms into the xml string.


Field Summary
protected  DataConfig config
          The config.
protected  java.util.HashMap<java.lang.String,java.lang.String> data
          The hash of data.
protected  int index
          The index of record.
protected  boolean skip
          The skip flag.
 
Constructor Summary
DataItem(java.util.HashMap<java.lang.String,java.lang.String> data, DataConfig config, int index)
          Instantiates a new data item.
 
Method Summary
 java.lang.String get_id()
          Gets the id of the record
 int get_index()
          Gets the index of the record
 java.lang.String get_value(java.lang.String name)
          Gets the value of the field
 void set_id(java.lang.String value)
          Sets the new id for the record
 void set_value(java.lang.String name, java.lang.String value)
          Sets value of the field
 void skip()
          Mark current record to be skipped ( not included in xml response )
 void to_xml_end(java.lang.StringBuffer out)
          Ending part of xml representation.
 void to_xml_start(java.lang.StringBuffer out)
          Starting part of xml representation
 void to_xml(java.lang.StringBuffer out)
          Convert data item to xml representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.HashMap<java.lang.String,java.lang.String> data
The hash of data.


config

protected DataConfig config
The config.


index

protected int index
The index of record.


skip

protected boolean skip
The skip flag.

Constructor Detail

DataItem

public DataItem(java.util.HashMap<java.lang.String,java.lang.String> data,
                DataConfig config,
                int index)
Instantiates a new data item.

Parameters:
data - the hash of data
config - the config
index - the index of record
Method Detail

get_value

public java.lang.String get_value(java.lang.String name)
Gets the value of the field

Parameters:
name - the name of the field
Returns:
the value of the field

set_value

public void set_value(java.lang.String name,
                      java.lang.String value)
Sets value of the field

Parameters:
name - the name of the field
value - the value of the field

get_id

public java.lang.String get_id()
Gets the id of the record

Returns:
the id of the record

set_id

public void set_id(java.lang.String value)
Sets the new id for the record

Parameters:
value - the new id for the record

get_index

public int get_index()
Gets the index of the record

Returns:
the index of the record

skip

public void skip()
Mark current record to be skipped ( not included in xml response )


to_xml

public void to_xml(java.lang.StringBuffer out)
Convert data item to xml representation

Parameters:
out - the output buffer

to_xml_start

public void to_xml_start(java.lang.StringBuffer out)
Starting part of xml representation

Parameters:
out - the output buffer

to_xml_end

public void to_xml_end(java.lang.StringBuffer out)
Ending part of xml representation.

Parameters:
out - the output buffer