com.irisel.oms.olapi.beans
Class DataInstance

java.lang.Object
  extended by com.irisel.util.BaseBean
      extended by com.irisel.oms.olapi.beans.XMLBean
          extended by com.irisel.oms.olapi.beans.DataInstance
All Implemented Interfaces:
Instance, XMLBean, java.io.Serializable
Direct Known Subclasses:
DataExchangeInstance

public class DataInstance
extends XMLBean
implements Instance

Author:
jgomalve
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.irisel.oms.olapi.beans.XMLBean
CLASSNAME, CLASSTYPE, DEFAULT_VISIBILITY, NOT_VISIBLE, VISIBLE
 
Fields inherited from interface com.irisel.oms.olapi.beans.Instance
PROPERTY_INDEX_NOT_FOUND
 
Fields inherited from interface com.irisel.util.XMLBean
CSV
 
Constructor Summary
DataInstance()
          Creates a new instance of DataInstance
DataInstance(ClassVO c)
           
DataInstance(long classid, java.lang.String classname, java.lang.String[] classnames, java.lang.String[] names, java.lang.String[] originalNames, java.lang.Object[] values, java.lang.String[] javaClassNames, java.lang.String type)
           
 
Method Summary
 void clone(Instance bean)
           
 void close()
           
 long getClassId()
           
 java.lang.String getClassname()
           
 java.lang.String[] getClassnames()
           
 GlobalID getGlid()
           
 GlobalID getGlobalId()
           
 int getIndex(java.lang.String name)
           
 java.lang.String getInstanceType()
           
 java.lang.String getName(int index)
           
 java.lang.String[] getOriginalNames()
           
 int getPropertyCount()
           
 java.lang.String[] getPropertyNames()
           
 java.lang.String getType()
           
 java.lang.Object getValue(int index)
           
 java.lang.Object getValue(java.lang.String name)
           
 java.lang.String getValueClassName(int i)
          Getter for property valuesClassNames.
 java.lang.Object[] getValues()
           
 java.lang.String[] getValuesClassNames()
          Getter for property valuesClassNames.
 boolean hasProperty(java.lang.String field_name)
           
 int name2index(java.lang.String name)
          Returns the index in the values vector corresponding to a column given by name
 void setAutomaticFields()
          Sets special fields with default or calculated values.
 void setClassId(long classId)
           
 void setClassname(java.lang.String classname)
           
 void setClassnames(java.lang.String[] classnames)
           
 void setGlid(GlobalID glid)
           
 void setId(long id)
           
 void setInstanceType(java.lang.String type)
           
 void setOriginalNames(java.lang.String[] originalNames)
           
 void setPropertyNames(java.lang.String[] names)
           
 void setType(java.lang.String type)
           
 void setValue(int index, java.lang.Object value)
           
 void setValue(java.lang.String name, java.lang.Object value)
           
 void setValues(java.lang.Object[] values)
           
 void setValuesClassNames(java.lang.String[] valuesClassNames)
          Setter for property valuesClassNames.
 JSONObject toJSONObject()
           
 java.util.Map toMap()
           
 java.lang.String toString()
           
 
Methods inherited from class com.irisel.oms.olapi.beans.XMLBean
copyToInstance, export2csv, getDescId, getGeneratedAt, getGenericAttr, getIcon, getIconName, getId, getLabel, getName, getO, getOrd, getVisibility, isDirty, isEnabled, isErased, isMandatory, isReadOnly, readFromFile, readFromStream, setDescId, setDirty, setEnabled, setErased, setGeneratedAt, setGenericAttr, setIcon, setIconName, setLabel, setName, setO, setOrd, setVisibility, updateFromInstance, writeToFile, writeToStream, xmlSerialize
 
Methods inherited from class com.irisel.util.BaseBean
decode64, decode64bin, encode64, encode64bin, readObject, readObject64, toBean, toByteArray, toJSON, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.irisel.oms.olapi.beans.Instance
encode64, getIcon, getId, isDirty, setDirty, setIcon, toJSON, toXML
 

Constructor Detail

DataInstance

public DataInstance()
Creates a new instance of DataInstance


DataInstance

public DataInstance(ClassVO c)

DataInstance

public DataInstance(long classid,
                    java.lang.String classname,
                    java.lang.String[] classnames,
                    java.lang.String[] names,
                    java.lang.String[] originalNames,
                    java.lang.Object[] values,
                    java.lang.String[] javaClassNames,
                    java.lang.String type)
Method Detail

name2index

public int name2index(java.lang.String name)
Returns the index in the values vector corresponding to a column given by name


getInstanceType

public java.lang.String getInstanceType()

getValue

public java.lang.Object getValue(int index)
Specified by:
getValue in interface Instance
Returns:
the value at index.

getValue

public java.lang.Object getValue(java.lang.String name)
Specified by:
getValue in interface Instance
Returns:
the value of the property given by name.

getValues

public java.lang.Object[] getValues()
Specified by:
getValues in interface Instance
Returns:
the array of values

setInstanceType

public void setInstanceType(java.lang.String type)

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
Specified by:
setValue in interface Instance

setValue

public void setValue(int index,
                     java.lang.Object value)
Specified by:
setValue in interface Instance

setValues

public void setValues(java.lang.Object[] values)
Specified by:
setValues in interface Instance

getPropertyCount

public int getPropertyCount()
Specified by:
getPropertyCount in interface Instance

getName

public java.lang.String getName(int index)
Specified by:
getName in interface Instance

getPropertyNames

public java.lang.String[] getPropertyNames()
Specified by:
getPropertyNames in interface Instance

setPropertyNames

public void setPropertyNames(java.lang.String[] names)
Specified by:
setPropertyNames in interface Instance

getIndex

public int getIndex(java.lang.String name)
Specified by:
getIndex in interface Instance

getValuesClassNames

public java.lang.String[] getValuesClassNames()
Getter for property valuesClassNames. Refers to the Java class name associated to each value

Returns:
Value of property valuesClassNames.

setValuesClassNames

public void setValuesClassNames(java.lang.String[] valuesClassNames)
Setter for property valuesClassNames. Refers to the Java class name associated to each value

Specified by:
setValuesClassNames in interface Instance
Parameters:
valuesClassNames - New value of property valuesClassNames.

getValueClassName

public java.lang.String getValueClassName(int i)
Getter for property valuesClassNames.

Specified by:
getValueClassName in interface Instance
Returns:
Value of property valuesClassNames.

close

public void close()

getClassname

public java.lang.String getClassname()
Specified by:
getClassname in interface Instance
Returns:
the oms class name

setType

public void setType(java.lang.String type)
Specified by:
setType in interface Instance

getType

public java.lang.String getType()
Specified by:
getType in interface Instance

getClassnames

public java.lang.String[] getClassnames()
Specified by:
getClassnames in interface Instance
Returns:
the oms class name array (for view records it may differ for each field)

toString

public java.lang.String toString()
Overrides:
toString in class XMLBean

setId

public void setId(long id)
Specified by:
setId in interface Instance
Overrides:
setId in class XMLBean

setClassname

public void setClassname(java.lang.String classname)
Specified by:
setClassname in interface Instance

getGlobalId

public GlobalID getGlobalId()

clone

public void clone(Instance bean)
Specified by:
clone in interface Instance

getGlid

public GlobalID getGlid()

setGlid

public void setGlid(GlobalID glid)

setClassnames

public void setClassnames(java.lang.String[] classnames)
Specified by:
setClassnames in interface Instance

getOriginalNames

public java.lang.String[] getOriginalNames()
Specified by:
getOriginalNames in interface Instance

setOriginalNames

public void setOriginalNames(java.lang.String[] originalNames)
Specified by:
setOriginalNames in interface Instance

hasProperty

public boolean hasProperty(java.lang.String field_name)
Specified by:
hasProperty in interface Instance

getClassId

public long getClassId()
Specified by:
getClassId in interface Instance

setClassId

public void setClassId(long classId)

toJSONObject

public JSONObject toJSONObject()
Overrides:
toJSONObject in class BaseBean

toMap

public java.util.Map toMap()
Specified by:
toMap in interface Instance

setAutomaticFields

public void setAutomaticFields()
Description copied from interface: Instance
Sets special fields with default or calculated values.

Specified by:
setAutomaticFields in interface Instance