public class FunctorFieldHandler extends Object implements IFieldHandler, INotificationSupport, IAttributeSupport
| Constructor and Description |
|---|
FunctorFieldHandler() |
FunctorFieldHandler(String name,
IFunctor getter,
IFunctor setter) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(EventType type,
INotificationListener listener)
Add
listener to the collection of objects to be informed
when the receiver triggers an event of type name. |
Object |
getAttribute(Object key)
Get an attribute value from the context
|
IFunctor |
getGetter() |
String |
getName() |
IFunctor |
getSetter() |
Object |
getValue(Object object)
Make a reflective read access to the field represented by this within the
receiver. |
Object |
removeAttribute(Object key)
Remove an attribute binding in the context
|
void |
removeNotificationListener(EventType type,
INotificationListener listener)
Remove
listener from the collection of objects to be
informed about events of type name. |
Object |
setAttribute(Object key,
Object value)
Set the value of an attribute in the context
|
void |
setGetter(IFunctor getter) |
void |
setName(String name) |
void |
setSetter(IFunctor setter) |
Object |
setValue(Object object,
Object value)
Make a reflective write access to the field represented by this within
receiver. |
public void addNotificationListener(EventType type, INotificationListener listener)
INotificationSupportlistener to the collection of objects to be informed
when the receiver triggers an event of type name.addNotificationListener in interface INotificationSupporttype - The event type we are interested in.listener - The object to be informed about an event occurrencepublic Object getAttribute(Object key)
IAttributeSupportgetAttribute in interface IAttributeSupportkey - the name of the attribute to getkeypublic IFunctor getGetter()
public String getName()
public IFunctor getSetter()
public Object getValue(Object object) throws FieldAccessException
IFieldHandlerreceiver.getValue in interface IFieldHandlerobject - The object hosting the field.FieldAccessExceptionpublic Object removeAttribute(Object key)
IAttributeSupportremoveAttribute in interface IAttributeSupportkey - the name of the attribute to removekeypublic void removeNotificationListener(EventType type, INotificationListener listener)
INotificationSupportlistener from the collection of objects to be
informed about events of type name.removeNotificationListener in interface INotificationSupporttype - The event type we are no longer interested in.listener - The object registered for the event till now.public Object setAttribute(Object key, Object value)
IAttributeSupportsetAttribute in interface IAttributeSupportkey - the name of the attribute to setvalue - the new value the attributekeypublic void setGetter(IFunctor getter)
public void setName(String name)
public void setSetter(IFunctor setter)
public Object setValue(Object object, Object value) throws FieldAccessException
IFieldHandlerreceiver.setValue in interface IFieldHandlerobject - The object hosting the field.value - The new value for the fieldFieldAccessExceptionCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.