|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.data.DataObject
This is an object which completely implements the DataUnit interface. The following is the default behavior.
getNew() will use the Reflection API to attempt to create a new instance of the object via a public default constructor. If successful, the object created will be returned.
getCopy() will call first call getNew() and then invoke copyFrom() on the created object passing it this object as a parameter.
copyFrom(Object other) envokes the ewe.util.Utils.copy(Object source,Object dest) with this as the destination and the "other"
compareTo() returns 0 if the two Objects are the same object, or 1 otherwise.
equals() returns true if compareTo() returns 0.
| Constructor Summary | |
DataObject()
|
|
| Method Summary | |
boolean |
_getSetField(String fieldName,
Wrapper wrapper,
boolean isGet)
This is used for data transfer using a ewe.reflect.FieldTransfer object. |
static String |
appendAllFields(String fieldName,
Object dataObject,
boolean declaredOnly)
|
int |
compareTo(Object other)
Compare this object with another. |
protected void |
copied(Object from)
This method is called after the base implementation of copyFrom() is executed. |
void |
copyFrom(Object other)
Copy all appropriate data from another object. |
boolean |
equals(Object other)
Returns if this object is considered equal to the other object. |
Object |
getCopy()
Return a copy of this object. |
Field |
getDeclaredField(String fieldName,
String baseClassName)
Get a declared field for this object for the specified baseClassName. |
Object |
getDeclaredFieldValue(String fieldName,
String baseClassName)
This returns the value of a declared field as an object. |
Wrapper |
getDeclaredFieldValue(String fieldName,
Wrapper destination,
String baseClassName)
Get the value of a declared field in a Wrapper object. |
static String |
getFieldList(Object objectOrClass,
boolean declaredOnly)
Get a comma separated list of fields for the specified object. |
static String |
getFieldList(Object reflectOrClass,
Object dataObject,
boolean declaredOnly)
|
String |
getMyFieldList(String baseClassName)
Gets the declared field list for a particular class in the class hierarchy of this LiveObject. |
Object |
getNew()
Return a new Object which is of the same class as the original. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, toString |
| Constructor Detail |
public DataObject()
| Method Detail |
public Object getCopy()
Copyable
getCopy in interface Copyablepublic void copyFrom(Object other)
DataUnit
copyFrom in interface DataUnitpublic int compareTo(Object other)
Comparable
compareTo in interface Comparablepublic boolean equals(Object other)
Object
equals in class Objectother - Another object to compare to.
public Object getNew()
DataUnit
getNew in interface DataUnit
public boolean _getSetField(String fieldName,
Wrapper wrapper,
boolean isGet)
By default this method calls getProperties() and then calls the _getSetField() method in PropertyList.
fieldName - The name of the field.wrapper - A wrapper containing the data to be assigned to the field or the wrapper into
which you should place the field data.isGet - if this is true then it is a get operation (in which case you should set
the wrapper value to be the field value) if it is false it is a set operation and
the wrapper contains the field value to assign to the field.
public static String getFieldList(Object objectOrClass,
boolean declaredOnly)
objectOrClass - the object, or Class of the object, or Reflect of the object.declaredOnly - if this is true only the field declared by the class (not those inherited)
are used.
public static String getFieldList(Object reflectOrClass,
Object dataObject,
boolean declaredOnly)
public String getMyFieldList(String baseClassName)
throws IllegalArgumentException
baseClassName - This should be the last part of the class name or the fully qualified class name.
For example if the object is of type samples.data.PersonInfo, the baseClassName can be "PersonInfo".
IllegalArgumentException - If the baseClassName does not appear in the class hierarchy.
public Field getDeclaredField(String fieldName,
String baseClassName)
throws IllegalArgumentException
fieldName - The fieldNamebaseClassName - This should be the last part of the class name or the fully qualified class name.
For example if the object is of type samples.data.PersonInfo, the baseClassName can be "PersonInfo".
IllegalArgumentException - If the baseClassName does not appear in the class hierarchy.
public Wrapper getDeclaredFieldValue(String fieldName,
Wrapper destination,
String baseClassName)
throws IllegalArgumentException
fieldName - The fieldNamedestination - a destination wrapper for the value. This can be null in which case a new one will be created.baseClassName - This should be the last part of the class name or the fully qualified class name.
For example if the object is of type samples.data.PersonInfo, the baseClassName can be "PersonInfo".
IllegalArgumentException - If the baseClassName does not appear in the class hierarchy.
public Object getDeclaredFieldValue(String fieldName,
String baseClassName)
throws IllegalArgumentException
fieldName - The fieldNamebaseClassName - This should be the last part of the class name or the fully qualified class name.
For example if the object is of type samples.data.PersonInfo, the baseClassName can be "PersonInfo".
IllegalArgumentException - If the baseClassName does not appear in the class hierarchy.
public static String appendAllFields(String fieldName,
Object dataObject,
boolean declaredOnly)
protected void copied(Object from)
from - The object that data was copied from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||