Package de.intarsys.tools.functor
Class FunctorFieldHandler
- java.lang.Object
-
- de.intarsys.tools.functor.FunctorFieldHandler
-
- All Implemented Interfaces:
IAttributeSupport,INotificationSupport,IFieldHandler
public class FunctorFieldHandler extends java.lang.Object implements IFieldHandler, INotificationSupport, IAttributeSupport
-
-
Constructor Summary
Constructors Constructor Description FunctorFieldHandler()FunctorFieldHandler(java.lang.String name, IFunctor getter, IFunctor setter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNotificationListener(EventType type, INotificationListener listener)Addlistenerto the collection of objects to be informed when the receiver triggers an event of typename.java.lang.ObjectgetAttribute(java.lang.Object key)Get an attribute value from the contextIFunctorgetGetter()java.lang.StringgetName()IFunctorgetSetter()java.lang.ObjectgetValue(java.lang.Object object)Make a reflective read access to the field represented by this within thereceiver.java.lang.ObjectremoveAttribute(java.lang.Object key)Remove an attribute binding in the contextvoidremoveNotificationListener(EventType type, INotificationListener listener)Removelistenerfrom the collection of objects to be informed about events of typename.java.lang.ObjectsetAttribute(java.lang.Object key, java.lang.Object value)Set the value of an attribute in the contextvoidsetGetter(IFunctor getter)voidsetName(java.lang.String name)voidsetSetter(IFunctor setter)java.lang.ObjectsetValue(java.lang.Object object, java.lang.Object value)Make a reflective write access to the field represented by this withinreceiver.
-
-
-
Method Detail
-
addNotificationListener
public void addNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupportAddlistenerto the collection of objects to be informed when the receiver triggers an event of typename.- Specified by:
addNotificationListenerin interfaceINotificationSupport- Parameters:
type- The event type we are interested in.listener- The object to be informed about an event occurrence
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object key)
Description copied from interface:IAttributeSupportGet an attribute value from the context- Specified by:
getAttributein interfaceIAttributeSupport- Parameters:
key- the name of the attribute to get- Returns:
- The value of the attribute
key
-
getGetter
public IFunctor getGetter()
-
getName
public java.lang.String getName()
-
getSetter
public IFunctor getSetter()
-
getValue
public java.lang.Object getValue(java.lang.Object object) throws FieldAccessExceptionDescription copied from interface:IFieldHandlerMake a reflective read access to the field represented by this within thereceiver.- Specified by:
getValuein interfaceIFieldHandler- Parameters:
object- The object hosting the field.- Returns:
- The field value
- Throws:
FieldAccessException
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.Object key)
Description copied from interface:IAttributeSupportRemove an attribute binding in the context- Specified by:
removeAttributein interfaceIAttributeSupport- Parameters:
key- the name of the attribute to remove- Returns:
- The previously associated value for
key
-
removeNotificationListener
public void removeNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupportRemovelistenerfrom the collection of objects to be informed about events of typename.- Specified by:
removeNotificationListenerin interfaceINotificationSupport- Parameters:
type- The event type we are no longer interested in.listener- The object registered for the event till now.
-
setAttribute
public java.lang.Object setAttribute(java.lang.Object key, java.lang.Object value)Description copied from interface:IAttributeSupportSet the value of an attribute in the context- Specified by:
setAttributein interfaceIAttributeSupport- Parameters:
key- the name of the attribute to setvalue- the new value the attribute- Returns:
- The previously associated value for
key
-
setGetter
public void setGetter(IFunctor getter)
-
setName
public void setName(java.lang.String name)
-
setSetter
public void setSetter(IFunctor setter)
-
setValue
public java.lang.Object setValue(java.lang.Object object, java.lang.Object value) throws FieldAccessExceptionDescription copied from interface:IFieldHandlerMake a reflective write access to the field represented by this withinreceiver.- Specified by:
setValuein interfaceIFieldHandler- Parameters:
object- The object hosting the field.value- The new value for the field- Returns:
- The previous field value. This is an optional feature.
- Throws:
FieldAccessException
-
-