de.intarsys.tools.functor
public class FunctorMethodHandler extends java.lang.Object implements IMethodHandler, IAttributeSupport
Constructor and Description |
---|
FunctorMethodHandler(java.lang.String name,
IFunctor invoker) |
Modifier and Type | Method and Description |
---|---|
static IMethodHandler |
create(IFunctor functor) |
java.lang.Object |
getAttribute(java.lang.Object key)
Get an attribute value from the context
|
IFunctor |
getInvoker() |
java.lang.String |
getName() |
java.lang.Object |
invoke(java.lang.Object receiver,
IArgs args)
Execute the implementation associated with this method in the context of
the
receiver and return the result. |
java.lang.Object |
removeAttribute(java.lang.Object key)
Remove an attribute binding in the context
|
java.lang.Object |
setAttribute(java.lang.Object key,
java.lang.Object value)
Set the value of an attribute in the context
|
public FunctorMethodHandler(java.lang.String name, IFunctor invoker)
public static IMethodHandler create(IFunctor functor)
public java.lang.Object getAttribute(java.lang.Object key)
IAttributeSupport
getAttribute
in interface IAttributeSupport
key
- the name of the attribute to getkey
public IFunctor getInvoker()
public java.lang.String getName()
public java.lang.Object invoke(java.lang.Object receiver, IArgs args) throws MethodInvocationException
IMethodHandler
receiver
and return the result.invoke
in interface IMethodHandler
receiver
- The object implementing the method.args
- The arguments for the invocation.MethodInvocationException
public java.lang.Object removeAttribute(java.lang.Object key)
IAttributeSupport
removeAttribute
in interface IAttributeSupport
key
- the name of the attribute to removekey
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