Class GWCoercionManager
- java.lang.Object
-
- gw.config.BaseService
-
- gw.lang.parser.StandardCoercionManager
-
- gw.internal.gosu.parser.gwPlatform.GWCoercionManager
-
- All Implemented Interfaces:
IService
,ICoercionManager
,IPluginHost
public class GWCoercionManager extends StandardCoercionManager
- Author:
- cgross
-
-
Field Summary
-
Fields inherited from class gw.lang.parser.StandardCoercionManager
_coercerCache, NO_DICE
-
-
Constructor Summary
Constructors Constructor Description GWCoercionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ICoercer
getCoercerInternal(IType lhsType, IType rhsType, boolean runtime)
Returns a coercer from values of rhsType to values of lhsType if one exists.BigDecimal
makeBigDecimalFrom(Object obj)
Rational
makeRationalFrom(Object obj)
String
makeStringFrom(Object obj)
-
Methods inherited from class gw.lang.parser.StandardCoercionManager
arePrimitiveTypesAssignable, canCoerce, convertNullAsPrimitive, convertValue, findCoercer, formatDate, formatNumber, formatTime, getHighPriorityPrimitiveOrBoxedConverter, getPrimitiveOrBoxedConverter, isBoxed, isDateTime, isObjectMethod, isPrimitiveOrBoxed, isStructurallyAssignable, isStructurallyAssignable_Laxed, isStructurallyAssignable_Laxed, isStructurallyAssignable_Laxed, makeBigIntegerFrom, makeBooleanFrom, makeDateFrom, makeDoubleFrom, makeFloatFrom, makeIntegerFrom, makeLongFrom, makePrimitiveBooleanFrom, makePrimitiveDoubleFrom, makePrimitiveFloatFrom, makePrimitiveIntegerFrom, makePrimitiveLongFrom, notCoercibleOrRequiresExplicitCoercion, parseDateTime, parseNumber, resolveCoercerStatically, verifyTypesComparable, verifyTypesComparable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gw.plugin.IPluginHost
getInterface
-
-
-
-
Method Detail
-
getCoercerInternal
public ICoercer getCoercerInternal(IType lhsType, IType rhsType, boolean runtime)
Description copied from class:StandardCoercionManager
Returns a coercer from values of rhsType to values of lhsType if one exists. I tried to write a reasonable spec in the comments below that indicate exactly what should coerce to what.- Overrides:
getCoercerInternal
in classStandardCoercionManager
- Parameters:
lhsType
- the type to coerce torhsType
- the type to coerce fromruntime
- true if the coercion is happening at runtime rather than compile time (note: This param should go away as we store the coercions on the parsed elements, rather than calling into the coercion manager)- Returns:
- a coercer from the lhsType to the rhsType, or null if no such coercer exists or is needed
-
makeStringFrom
public String makeStringFrom(Object obj)
- Specified by:
makeStringFrom
in interfaceICoercionManager
- Overrides:
makeStringFrom
in classStandardCoercionManager
-
makeBigDecimalFrom
public BigDecimal makeBigDecimalFrom(Object obj)
- Specified by:
makeBigDecimalFrom
in interfaceICoercionManager
- Overrides:
makeBigDecimalFrom
in classStandardCoercionManager
-
makeRationalFrom
public Rational makeRationalFrom(Object obj)
- Specified by:
makeRationalFrom
in interfaceICoercionManager
- Overrides:
makeRationalFrom
in classStandardCoercionManager
-
-