Package gw.lang.parser.coercers
Class FunctionFromInterfaceCoercer
java.lang.Object
gw.lang.parser.coercers.BaseCoercer
gw.lang.parser.coercers.FunctionFromInterfaceCoercer
- All Implemented Interfaces:
ICoercer
-
Field Summary
FieldsFields inherited from interface gw.lang.parser.ICoercer
MAX_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareTypesCompatible(IFunctionType functionType, IType interfaceType) coerceValue(IType typeToCoerceTo, Object value) static ObjectdoCoercion(Class classToCoerceTo, Class ifaceClass, Object value) private static MethodfindSingleAbstractMethod(Class ifaceClass) intgetPriority(IType to, IType from) booleanstatic FunctionFromInterfaceCoercerinstance()boolean
-
Field Details
-
_instance
-
-
Constructor Details
-
FunctionFromInterfaceCoercer
private FunctionFromInterfaceCoercer()
-
-
Method Details
-
instance
-
handlesNull
public boolean handlesNull()- Returns:
- true if this coercer knows how to handle the null value.
-
coerceValue
-
doCoercion
-
findSingleAbstractMethod
-
isExplicitCoercion
public boolean isExplicitCoercion() -
areTypesCompatible
-
getPriority
- Returns:
- a value between 0 and MAX_PRIORITY, inclusive that indicates the priority of this coercer when resolving overloaded methods. Typically a coercer should return 0, but coercers that have a high affinity between the target and coerced type, such as primitives, can have higher priorities.
-