public class FieldTransfer extends Object implements IFieldTransfer
Modifier and Type | Field and Description |
---|---|
DataConverter |
converter
An optional DataConverter.
|
Object |
dataInterface
This is the Control used for the field in an Editor.
|
Object |
dataObject
The data object being used.
|
Field |
field
The field in the Object (if one exists).
|
Object |
fieldEvent
The field event that occured.
|
String |
fieldName
The full name of the field along with sub specifier.
|
Class |
fieldType
The type of the field.
|
static int |
FROM_OBJECT |
String |
fullFieldName
The full field name with all specifiers as specified in the constructor.
|
Method |
getFieldMethod
The getField method used on the data object.
|
Method |
getMethod
The get() method used on the data interface - this is not used on the data object.
|
Method |
getSetFieldMethod
The combined getSetField() method used on the data object.
|
boolean |
getSetFieldMethodUsesFullFieldName |
Method |
getSetMethod
The combined getSet() method used on the data interface.
|
Class |
ifType
The type of the data used by the interface object.
|
protected IFieldTransfer |
myTransfer
This holds the IFieldTransfer set by setTransfer().
|
Field |
ownedProperties
If the field name specifies a named property this is the Field
that is the OwnedProperties object itself.
|
String |
ownedPropertyName
If the field name specifies a named property this is the name
of the property in the OwnedProperties object.
|
String |
pureName
The pure Java name of the field without any extra specifiers.
|
Method |
setFieldMethod
The setField method used on the data object.
|
Method |
setMethod
The set() method used on the data interface - this is not used on the data object.
|
static int |
TO_OBJECT |
static int |
TRANSFER_OPTION_AUTO_REFRESH_DATA_INTERFACE
If this option is set in transferOptions, then whenever data is transferred
from the dataInterface to the Object it is automatically sent back from the
Object to the dataInterface.
|
int |
transferOptions
Any of the TRANSFER_OPTION_XXX values can be used here.
|
Class |
transferType
The type of the data being transfered.
|
Constructor and Description |
---|
FieldTransfer(Class objectClass,
Object sampleOrDataObject,
String fieldName,
Object dataInterface,
DataConverter converter) |
FieldTransfer(Object objectOrClass,
String fieldName) |
FieldTransfer(Object objectOrClass,
String fieldName,
DataInterface dataInterface) |
FieldTransfer(String fieldName)
This is only used to create a dummy field transfer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDoGetSet(boolean canDoGet)
Return if the IFieldTransfer can do a getFieldValue() or setFieldValue().
|
void |
changeDataInterfaceClass(Class dataInterfaceClass) |
void |
changeDataInterfaceWithSameClass(Object dataInterface)
Change the DataInterface for the FieldTransfer assuming it is the same
Class as the one used when it was created.
|
boolean |
equals(Object other)
This works by comparing the "fieldName" fields for equality.
|
Object |
getFieldJavaValue(Object src) |
Class |
getFieldType() |
Object |
getFieldValue(Object obj)
Get the field value only if it is an Object.
|
boolean |
getFieldValue(Object obj,
FetchData fetchData,
Wrapper dest) |
boolean |
getFieldValue(Object obj,
Wrapper dest)
Get the field value from the data object and place in the destination Wrapper.
|
FieldTransfer |
getFor(Object data,
DataInterface dataInterface) |
boolean |
getSetMethodAfterGet(Object obj) |
Wrapper[] |
getSetMethodSetupForGet(Object obj) |
boolean |
isField(String field) |
boolean |
isValid()
Returns true if this FieldTransfer can actually do a transfer.
|
void |
newDataInterface(Object dataInterface) |
boolean |
setFieldJavaValue(Object dest,
Object value) |
boolean |
setFieldValue(Object obj,
FetchData fetchData,
Wrapper value) |
boolean |
setFieldValue(Object obj,
Wrapper value) |
boolean |
setMethodsFor(Class classType,
String getMethodNameAndSignature,
String setMethodNameAndSignature) |
void |
setTransfer(IFieldTransfer ft)
Set a separate IFieldTransfer - this will cause this FieldTransfer object
to defer the transfer(Object obj,int direction) to this IFieldTransfer.
|
String |
toString()
Return a String representation of this object.
|
void |
transfer(int direction)
This uses the "dataObject" variable as the object for field transfer.
|
boolean |
transfer(Object obj,
int direction) |
FieldTransfer |
updateFrom(Object data,
DataInterface di) |
public Object dataInterface
public Method setMethod
public Method getMethod
public Method getSetMethod
public Method getSetFieldMethod
public boolean getSetFieldMethodUsesFullFieldName
public Method getFieldMethod
public Method setFieldMethod
public Field ownedProperties
public String ownedPropertyName
public Field field
public String fieldName
public Class fieldType
public Class transferType
public Class ifType
public String pureName
public String fullFieldName
protected IFieldTransfer myTransfer
public DataConverter converter
public Object fieldEvent
public Object dataObject
public static final int TRANSFER_OPTION_AUTO_REFRESH_DATA_INTERFACE
public int transferOptions
public static final int TO_OBJECT
public static final int FROM_OBJECT
public FieldTransfer(String fieldName)
public FieldTransfer(Object objectOrClass, String fieldName, DataInterface dataInterface)
public FieldTransfer(Class objectClass, Object sampleOrDataObject, String fieldName, Object dataInterface, DataConverter converter)
public void setTransfer(IFieldTransfer ft)
ft
- the IFieldTransfer to set.public boolean setMethodsFor(Class classType, String getMethodNameAndSignature, String setMethodNameAndSignature)
public FieldTransfer updateFrom(Object data, DataInterface di)
public FieldTransfer getFor(Object data, DataInterface dataInterface)
public void changeDataInterfaceWithSameClass(Object dataInterface)
dataInterface
- the new dataInterface.public void changeDataInterfaceClass(Class dataInterfaceClass)
public void newDataInterface(Object dataInterface)
public boolean isValid()
public boolean isField(String field)
public Class getFieldType()
getFieldType
in interface IFieldTransfer
public boolean canDoGetSet(boolean canDoGet)
IFieldTransfer
canDoGetSet
in interface IFieldTransfer
canDoGet
- true to see if it can do a get, false to see if it can do a set.public boolean getFieldValue(Object obj, Wrapper dest)
obj
- the data Object.dest
- a non-null Wrapper.public boolean setFieldValue(Object obj, FetchData fetchData, Wrapper value)
setFieldValue
in interface IFieldTransfer
public boolean getFieldValue(Object obj, FetchData fetchData, Wrapper dest)
getFieldValue
in interface IFieldTransfer
public Object getFieldValue(Object obj)
obj
- the data object.public void transfer(int direction)
public boolean getSetMethodAfterGet(Object obj)
public boolean transfer(Object obj, int direction)
public String toString()
Object
public boolean equals(Object other)