org.escot
Class PropertyAdapter
java.lang.Object
|
+--org.escot.BasicFeature
|
+--org.escot.PropertyAdapter
- All Implemented Interfaces:
- EscotFeature, EscotReferenced
- public class PropertyAdapter
- extends BasicFeature
- implements EscotReferenced
The PropertyAdapter class represents a property other than
number or string. If it has a setter it may be replaced with
another instance of the type specified by the
return type of the PropertyDescriptor.
The feature has an original value which may be null.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mClass
protected Class mClass
mDescriptor
protected PropertyDescriptor mDescriptor
mBean
protected Object mBean
mOriginalReference
protected Object mOriginalReference
mReference
protected Object mReference
PropertyAdapter
public PropertyAdapter(Object bean,
PropertyDescriptor desc)
isReplaceable
public boolean isReplaceable()
- Description copied from interface:
EscotReferenced
- Returns whether the reference can be replaced.
- Specified by:
isReplaceable in interface EscotReferenced
canReplaceReferenceWith
public boolean canReplaceReferenceWith(Object reference)
- Description copied from interface:
EscotReferenced
- Returns whether the reference can be replaced by the
specified object.
- Specified by:
canReplaceReferenceWith in interface EscotReferenced
- Following copied from interface:
org.escot.EscotReferenced
- Parameters:
obj - the object that will replace the existing reference.
replaceReferenceWith
public void replaceReferenceWith(Object reference)
throws IllegalArgumentException
- Description copied from interface:
EscotReferenced
- Replaces the existing reference with the specified object.
- Specified by:
replaceReferenceWith in interface EscotReferenced
- Following copied from interface:
org.escot.EscotReferenced
- Parameters:
obj - the object that will replace the existing reference.
cancelReference
public void cancelReference(Object reference)
- Description copied from interface:
EscotReferenced
- Reverts the reference to the original reference by calling
the setter. Does nothing if reference wasn't replaced, or
if the reference provided is not the current one.
- Specified by:
cancelReference in interface EscotReferenced
- Following copied from interface:
org.escot.EscotReferenced
- Parameters:
obj - the object to be cancelled
getReference
public Object getReference()
- Description copied from interface:
EscotReferenced
- Returns the reference.
- Specified by:
getReference in interface EscotReferenced
getValue
protected Object getValue()
setValue
protected void setValue(Object value)