Package gw.lang.parser.coercers
Class BasePHighPriorityCoercer
java.lang.Object
gw.lang.parser.coercers.BaseCoercer
gw.lang.parser.coercers.BasePHighPriorityCoercer
- All Implemented Interfaces:
ICoercer
- Direct Known Subclasses:
BooleanPHighPriorityCoercer
,BytePHighPriorityCoercer
,CharPHighPriorityCoercer
,DoublePHighPriorityCoercer
,FloatPHighPriorityCoercer
,IntPHighPriorityCoercer
,LongPHighPriorityCoercer
,ShortPHighPriorityCoercer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LockingLazyVar<BasePrimitiveCoercer>
private final int
Fields inherited from interface gw.lang.parser.ICoercer
MAX_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionBasePHighPriorityCoercer
(LockingLazyVar<BasePrimitiveCoercer> delegate, int priority) -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
coerceValue
(IType typeToCoerceTo, Object value) int
getPriority
(IType to, IType from) boolean
boolean
-
Field Details
-
_delegate
-
_priority
private final int _priority
-
-
Constructor Details
-
BasePHighPriorityCoercer
-
-
Method Details
-
coerceValue
-
isExplicitCoercion
public boolean isExplicitCoercion() -
handlesNull
public boolean handlesNull()- Returns:
- true if this coercer knows how to handle the null value.
-
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.
-