org.eclipse.xtend.middleend.javaannotations.internal
Class JavaDefinedFunction
java.lang.Object
org.eclipse.xtend.backend.functions.AbstractFunction
org.eclipse.xtend.middleend.javaannotations.internal.JavaDefinedFunction
- All Implemented Interfaces:
- Function
public final class JavaDefinedFunction
- extends AbstractFunction
This class represents a "helper" function that is defined in a Java class but for which the defining
object is not an explicit parameter. It is used for "JAVA extension" style functions.
If it represents a non-static method, a single instance of the underlying class is shared by all methods
of the class, and across all compilation units etc. from which they are referenced. This single instance
is scoped with the ExecutionContext used.
- Author:
- Arno Haase (http://www.haase-consulting.com)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JavaDefinedFunction
public JavaDefinedFunction(java.lang.reflect.Method mtd,
ExpressionBase guard,
BackendTypesystem ts)
- shortcut constructor that attempts to derive the parameter types from the method's signature
JavaDefinedFunction
public JavaDefinedFunction(java.lang.reflect.Method mtd,
java.util.List<BackendType> parameterTypes,
BackendType returnType,
ExpressionBase guard)
- This constructor provides full control
guessParameterTypes
public static java.util.List<BackendType> guessParameterTypes(java.lang.reflect.Method mtd,
BackendTypesystem ts)
getName
public java.lang.String getName()
getMethod
public java.lang.reflect.Method getMethod()
invoke
public java.lang.Object invoke(ExecutionContext ctx,
java.lang.Object[] params)
- Description copied from interface:
Function
- this method is permitted to modify the param array that is passed in
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object