intarsys runtime library

de.intarsys.tools.objectmodel
Class FunctorMethod

java.lang.Object
  extended by de.intarsys.tools.objectmodel.Member
      extended by de.intarsys.tools.objectmodel.FunctorMethod
All Implemented Interfaces:
IMember, IMethod, IReturnTypeInfo, ISignatureInfo, IMethodHandler

public class FunctorMethod
extends Member
implements IMethod

The wrapper around an IFunctor to make it an IMethod.


Constructor Summary
FunctorMethod(String name, IFunctor functor)
           
 
Method Summary
 String getName()
          The name of the IMember.
 IClass[] getParameterTypes()
           
 IClass getReturnType()
          The declared type of the executable.
 Object invoke(Object receiver, IArgs args)
          Execute the implementation associated with this method in the context of the receiver and return the result.
 
Methods inherited from class de.intarsys.tools.objectmodel.Member
getDeclaringClass, hasModifier, setDeclaringClass, setModifiers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.intarsys.tools.objectmodel.IMember
getDeclaringClass, hasModifier
 

Constructor Detail

FunctorMethod

public FunctorMethod(String name,
                     IFunctor functor)
Method Detail

getName

public String getName()
Description copied from interface: IMember
The name of the IMember.

Specified by:
getName in interface IMember
Specified by:
getName in interface ISignatureInfo
Returns:
The name of the IMember.

getParameterTypes

public IClass[] getParameterTypes()
Specified by:
getParameterTypes in interface ISignatureInfo

getReturnType

public IClass getReturnType()
Description copied from interface: IReturnTypeInfo
The declared type of the executable.

Specified by:
getReturnType in interface IReturnTypeInfo
Returns:
The declared type of the field.

invoke

public Object invoke(Object receiver,
                     IArgs args)
              throws MethodInvocationException
Description copied from interface: IMethodHandler
Execute the implementation associated with this method in the context of the receiver and return the result.

Specified by:
invoke in interface IMethodHandler
Parameters:
receiver - The object implementing the method.
args - The arguments for the invocation.
Returns:
The result of the invocation.
Throws:
MethodInvocationException

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.