Class FunctorFieldHandler

java.lang.Object
de.intarsys.tools.functor.FunctorFieldHandler
All Implemented Interfaces:
IAttributeSupport, INotificationSupport, IFieldHandler

public class FunctorFieldHandler extends Object implements IFieldHandler, INotificationSupport, IAttributeSupport
  • Constructor Details

    • FunctorFieldHandler

      public FunctorFieldHandler()
    • FunctorFieldHandler

      public FunctorFieldHandler(String name, IFunctor getter, IFunctor setter)
  • Method Details

    • addNotificationListener

      public void addNotificationListener(EventType type, INotificationListener listener)
      Description copied from interface: INotificationSupport
      Add listener to the collection of objects to be informed when the receiver triggers an event of type name.
      Specified by:
      addNotificationListener in interface INotificationSupport
      Parameters:
      type - The event type we are interested in.
      listener - The object to be informed about an event occurrence
    • getAttribute

      public Object getAttribute(Object key)
      Description copied from interface: IAttributeSupport
      Get an attribute value from the context
      Specified by:
      getAttribute in interface IAttributeSupport
      Parameters:
      key - the name of the attribute to get
      Returns:
      The value of the attribute key
    • getGetter

      public IFunctor getGetter()
    • getName

      public String getName()
    • getSetter

      public IFunctor getSetter()
    • getValue

      public Object getValue(Object object) throws FieldAccessException
      Description copied from interface: IFieldHandler
      Make a reflective read access to the field represented by this within the receiver.
      Specified by:
      getValue in interface IFieldHandler
      Parameters:
      object - The object hosting the field.
      Returns:
      The field value
      Throws:
      FieldAccessException
    • removeAttribute

      public Object removeAttribute(Object key)
      Description copied from interface: IAttributeSupport
      Remove an attribute binding in the context
      Specified by:
      removeAttribute in interface IAttributeSupport
      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: INotificationSupport
      Remove listener from the collection of objects to be informed about events of type name.
      Specified by:
      removeNotificationListener in interface INotificationSupport
      Parameters:
      type - The event type we are no longer interested in.
      listener - The object registered for the event till now.
    • setAttribute

      public Object setAttribute(Object key, Object value)
      Description copied from interface: IAttributeSupport
      Set the value of an attribute in the context
      Specified by:
      setAttribute in interface IAttributeSupport
      Parameters:
      key - the name of the attribute to set
      value - the new value the attribute
      Returns:
      The previously associated value for key
    • setGetter

      public void setGetter(IFunctor getter)
    • setName

      public void setName(String name)
    • setSetter

      public void setSetter(IFunctor setter)
    • setValue

      public Object setValue(Object object, Object value) throws FieldAccessException
      Description copied from interface: IFieldHandler
      Make a reflective write access to the field represented by this within receiver.
      Specified by:
      setValue in interface IFieldHandler
      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