Package gw.lang.parser.coercers
Class TypeVariableCoercer
- java.lang.Object
-
- gw.lang.parser.coercers.TypeVariableCoercer
-
-
Field Summary
-
Fields inherited from interface gw.lang.parser.ICoercer
MAX_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description TypeVariableCoercer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectcoerceValue(IType typeToCoerceTo, Object value)intgetPriority(IType to, IType from)booleanhandlesNull()static TypeVariableCoercerinstance()booleanisExplicitCoercion()
-
-
-
Method Detail
-
coerceValue
public Object coerceValue(IType typeToCoerceTo, Object value)
- Specified by:
coerceValuein interfaceICoercer
-
isExplicitCoercion
public boolean isExplicitCoercion()
- Specified by:
isExplicitCoercionin interfaceICoercer
-
handlesNull
public boolean handlesNull()
- Specified by:
handlesNullin interfaceICoercer- Returns:
- true if this coercer knows how to handle the null value.
-
getPriority
public int getPriority(IType to, IType from)
- Specified by:
getPriorityin interfaceICoercer- 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.
-
instance
public static TypeVariableCoercer instance()
-
-