Package gw.lang.reflect.features
Class MethodReference<R,T>
- java.lang.Object
-
- gw.lang.reflect.features.FeatureReference<R,T>
-
- gw.lang.reflect.features.MethodReference<R,T>
-
- All Implemented Interfaces:
IFeatureReference<R,T>,IInvokableFeatureReference<R,T>,IMethodReference<R,T>
public class MethodReference<R,T> extends FeatureReference<R,T> implements IMethodReference<R,T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]_boundValuesprivate IMethodInfo_miprivate IType_rootTypeprivate boolean_voidReturn
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodReference()MethodReference(IType rootType, java.lang.String funcName, IType[] params, java.lang.Object[] boundValues)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodReferencecopyWithVoidReturn()booleanequals(java.lang.Object o)java.lang.Objectevaluate(java.lang.Object... args)Evaluates reflectivelyprotected java.lang.Objectevaluate(java.util.Iterator args)java.lang.Object[]getBoundArgValues()java.lang.Object[]getBoundValues()IFeatureInfogetFeatureInfo()java.util.List<IType>getFullArgTypes()TgetInvoke()Returns the method reference as a block in an invocation-friendly syntaxIMethodInfogetMethodInfo()Returns the method info for this reference(package private) static IMethodInfogetMethodInfo(IType rootType, java.lang.String funcName, IType[] params)ITypegetRootType()inthashCode()protected booleanhasReturn()TtoBlock()Returns the method reference as a block in a transformation-friendly syntax
-
-
-
Field Detail
-
_mi
private IMethodInfo _mi
-
_rootType
private IType _rootType
-
_boundValues
private java.lang.Object[] _boundValues
-
_voidReturn
private boolean _voidReturn
-
-
Method Detail
-
copyWithVoidReturn
public MethodReference copyWithVoidReturn()
- Specified by:
copyWithVoidReturnin interfaceIMethodReference<R,T>
-
hasReturn
protected boolean hasReturn()
- Overrides:
hasReturnin classFeatureReference<R,T>
-
getMethodInfo
static IMethodInfo getMethodInfo(IType rootType, java.lang.String funcName, IType[] params)
-
getMethodInfo
public IMethodInfo getMethodInfo()
Description copied from interface:IMethodReferenceReturns the method info for this reference- Specified by:
getMethodInfoin interfaceIMethodReference<R,T>
-
getInvoke
public T getInvoke()
Description copied from interface:IInvokableFeatureReferenceReturns the method reference as a block in an invocation-friendly syntax- Specified by:
getInvokein interfaceIInvokableFeatureReference<R,T>
-
toBlock
public T toBlock()
Description copied from interface:IInvokableFeatureReferenceReturns the method reference as a block in a transformation-friendly syntax- Specified by:
toBlockin interfaceIInvokableFeatureReference<R,T>
-
getBoundArgValues
public java.lang.Object[] getBoundArgValues()
- Specified by:
getBoundArgValuesin interfaceIInvokableFeatureReference<R,T>- Returns:
- an array of bound values if the feature had them, and null otherwise
-
evaluate
public java.lang.Object evaluate(java.lang.Object... args)
Description copied from interface:IInvokableFeatureReferenceEvaluates reflectively- Specified by:
evaluatein interfaceIInvokableFeatureReference<R,T>
-
evaluate
protected java.lang.Object evaluate(java.util.Iterator args)
- Specified by:
evaluatein classFeatureReference<R,T>
-
getFullArgTypes
public java.util.List<IType> getFullArgTypes()
- Specified by:
getFullArgTypesin classFeatureReference<R,T>
-
getFeatureInfo
public IFeatureInfo getFeatureInfo()
- Specified by:
getFeatureInfoin interfaceIFeatureReference<R,T>
-
getRootType
public IType getRootType()
- Specified by:
getRootTypein interfaceIFeatureReference<R,T>
-
getBoundValues
public java.lang.Object[] getBoundValues()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-