public class FunctorFieldHandler extends java.lang.Object implements IFieldHandler, INotificationSupport, IAttributeSupport
Constructor and Description |
---|
FunctorFieldHandler() |
FunctorFieldHandler(java.lang.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 . |
java.lang.Object |
getAttribute(java.lang.Object key)
Get an attribute value from the context
|
IFunctor |
getGetter() |
java.lang.String |
getName() |
IFunctor |
getSetter() |
java.lang.Object |
getValue(java.lang.Object object)
Make a reflective read access to the field represented by this within the
receiver . |
java.lang.Object |
removeAttribute(java.lang.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 . |
java.lang.Object |
setAttribute(java.lang.Object key,
java.lang.Object value)
Set the value of an attribute in the context
|
void |
setGetter(IFunctor getter) |
void |
setName(java.lang.String name) |
void |
setSetter(IFunctor setter) |
java.lang.Object |
setValue(java.lang.Object object,
java.lang.Object value)
Make a reflective write access to the field represented by this within
receiver . |
public void addNotificationListener(EventType type, INotificationListener listener)
INotificationSupport
listener
to the collection of objects to be informed
when the receiver triggers an event of type name
.addNotificationListener
in interface INotificationSupport
type
- The event type we are interested in.listener
- The object to be informed about an event occurrencepublic java.lang.Object getAttribute(java.lang.Object key)
IAttributeSupport
getAttribute
in interface IAttributeSupport
key
- the name of the attribute to getkey
public IFunctor getGetter()
public java.lang.String getName()
public IFunctor getSetter()
public java.lang.Object getValue(java.lang.Object object) throws FieldAccessException
IFieldHandler
receiver
.getValue
in interface IFieldHandler
object
- The object hosting the field.FieldAccessException
public java.lang.Object removeAttribute(java.lang.Object key)
IAttributeSupport
removeAttribute
in interface IAttributeSupport
key
- the name of the attribute to removekey
public void removeNotificationListener(EventType type, INotificationListener listener)
INotificationSupport
listener
from the collection of objects to be
informed about events of type name
.removeNotificationListener
in interface INotificationSupport
type
- The event type we are no longer interested in.listener
- The object registered for the event till now.public java.lang.Object setAttribute(java.lang.Object key, java.lang.Object value)
IAttributeSupport
setAttribute
in interface IAttributeSupport
key
- the name of the attribute to setvalue
- the new value the attributekey
public void setGetter(IFunctor getter)
public void setName(java.lang.String name)
public void setSetter(IFunctor setter)
public java.lang.Object setValue(java.lang.Object object, java.lang.Object value) throws FieldAccessException
IFieldHandler
receiver
.setValue
in interface IFieldHandler
object
- The object hosting the field.value
- The new value for the fieldFieldAccessException