|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.core.ClassExtension
ariba.util.fieldvalue.FieldValue
ariba.util.fieldvalue.FieldValue_Object
public class FieldValue_Object
The FieldValue_Object class extension is the default implementation of the FieldValue interface. This default implementation is based on java.lang.reflection primitives and will work for essentailly all classes. Of course, certain subclasses may desire to alter the default behavior and, as such, should subclass this class and override the appropriate methods. For example, a Map implementation may want to treat the fieldName as a key for get/put rather than as the name of an instance variable. Some other subclass may desire to mix and match the two approaches. In any case, these special cases should be implemented in subclasses of FieldValue_Object.
| Field Summary |
|---|
| Fields inherited from class ariba.util.fieldvalue.FieldValue |
|---|
Getter, Setter |
| Fields inherited from class ariba.util.core.ClassExtension |
|---|
forClass |
| Constructor Summary | |
|---|---|
FieldValue_Object()
|
|
| Method Summary | |
|---|---|
FieldValueAccessor |
createAccessor(Object target,
String fieldName,
int type)
Creates and returns a new FieldValueAccessor (by default, a ReflectionFieldValueAccessor) for the given target and fieldName. |
FieldValueAccessor |
getAccessor(Object target,
String fieldName,
int type)
Maintains a cache of FieldValueAccessor's for the instance by fieldName. |
Object |
getFieldValue(Object target,
FieldPath fieldPath)
Recursively calls getFieldValuePrimitive() with the head of the fieldPath list. |
Object |
getFieldValuePrimitive(Object target,
FieldPath fieldPath)
Gets the value from the reveiver using the fieldName indicated by fieldPath -- only the first node of the fieldPath is considered if it is a multi-node path. |
void |
populateFieldInfo(Class targetClass,
FieldInfo.Collection collection)
Called by FieldInfo.fieldInfoForClass() to populate FieldInfo.Collection with information on available fields. |
void |
setFieldValue(Object target,
FieldPath fieldPath,
Object value)
Recursively calls getFieldValuePrimitive() with the head of the fieldPath list up to the last fieldPath node and then calls setFieldValuePrimitive(). |
void |
setFieldValuePrimitive(Object target,
FieldPath fieldPath,
Object value)
Sets the value on the reveiver using the fieldName indicated by fieldPath -- only the first node of the fieldPath is considered if it is a multi-node path. |
| Methods inherited from class ariba.util.fieldvalue.FieldValue |
|---|
get, get, getFieldValue, registerClassExtension, setFieldValue |
| Methods inherited from class ariba.util.core.ClassExtension |
|---|
clone, forClass, getRealClass, setForClass |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FieldValue_Object()
| Method Detail |
|---|
public FieldValueAccessor createAccessor(Object target,
String fieldName,
int type)
createAccessor in class FieldValuetarget - the object for which the accessor will be createdfieldName - the name of the field for which the accessor will be createdtype - the type of accessor will be created (either FieldValue.Setter
or FieldValue.Getter)
public FieldValueAccessor getAccessor(Object target,
String fieldName,
int type)
getAccessor in class FieldValuetarget - the object for which the accessor will be looked upfieldName - the name of the field for the accessortype - the type of accessor will be created (either FieldValue.Setter
or FieldValue.Getter)
public void setFieldValuePrimitive(Object target,
FieldPath fieldPath,
Object value)
setFieldValuePrimitive in class FieldValuetarget - the object on which the value will be set for the field identiifed by fieldPathfieldPath - the fieldPath node (which contains a candidate accessor) to be
used to set the value on target.value - the value to set on the target
public Object getFieldValuePrimitive(Object target,
FieldPath fieldPath)
getFieldValuePrimitive in class FieldValuetarget - the object from which to get the value of the field identified by fieldPathfieldPath - the fieldPath node which identifes the field to get.
public void setFieldValue(Object target,
FieldPath fieldPath,
Object value)
setFieldValue in class FieldValuetarget - the object on which to start the recursion for setting
the value using the fieldPathfieldPath - the linked list of fieldPath nodes used to navigate from
target to the final object in the chain, upon which the value is setvalue - the value which is set on the final object in the chain
public Object getFieldValue(Object target,
FieldPath fieldPath)
getFieldValue in class FieldValuetarget - the first object from which to start the recursion for getting
the value identified by the fieldPath.fieldPath - the linked list of fieldPath nodes that identifes the value to get
public void populateFieldInfo(Class targetClass,
FieldInfo.Collection collection)
FieldValue
populateFieldInfo in class FieldValuetargetClass - class for which info should be provided.collection - repository to populate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||