Interface ICoercionManager
- All Superinterfaces:
IPluginHost, IService
- All Known Implementing Classes:
GWCoercionManager, StandardCoercionManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanconvertNullAsPrimitive(IType intrType, boolean isForBoxing) Converts a null value to a value compatible with the specified primitive type.convertValue(Object value, IType intrType) findCoercer(IType lhsType, IType rhsType, boolean runtime) formatDate(Date value, String strFormat) formatNumber(Double value, String strFormat) formatTime(Date value, String strFormat) booleanisDateTime(String str) booleanisPrimitiveOrBoxed(IType type) Determine whether the specified type is either a primitive or a boxed primitive.makeBigDecimalFrom(Object obj) makeBigIntegerFrom(Object obj) makeBooleanFrom(Object obj) makeDateFrom(Object obj) Returns a new Date instance representing the object.makeDoubleFrom(Object obj) Returns a Double for an arbitrary object.makeFloatFrom(Object obj) makeIntegerFrom(Object obj) makeLongFrom(Object obj) booleandoublefloatintlongmakeRationalFrom(Object obj) makeStringFrom(Object obj) booleannotCoercibleOrRequiresExplicitCoercion(IType lhsType, IType rhsType) parseDateTime(String str) Produce a date from a string using standard DateFormat parsing.parseNumber(String strValue) resolveCoercerStatically(IType lhsType, IType rhsType) Determine and return a statically valid coercer from the rhsType to the lhsType.verifyTypesComparable(IType lhsType, IType rhsType, boolean bBiDirectional) Verifies that the right hand type can be converted or coerced to the left hand type.verifyTypesComparable(IType lhsType, IType rhsType, boolean bBiDirectional, IFullParserState parserState) Verifies that the right hand type can be converted or coerced to the left hand type.Methods inherited from interface IPluginHost
getInterface
-
Method Details
-
canCoerce
-
convertValue
-
notCoercibleOrRequiresExplicitCoercion
-
verifyTypesComparable
Verifies that the right hand type can be converted or coerced to the left hand type. If bBiDirectional is true, it will verify that either converts to another- Throws:
ParseIssue
-
verifyTypesComparable
IType verifyTypesComparable(IType lhsType, IType rhsType, boolean bBiDirectional, IFullParserState parserState) throws ParseIssue Verifies that the right hand type can be converted or coerced to the left hand type. If bBiDirectional is true, it will verify that either converts to another. The parser state will be used to report parse errors with.- Throws:
ParseIssue
-
convertNullAsPrimitive
-
findCoercer
-
resolveCoercerStatically
-
isPrimitiveOrBoxed
Determine whether the specified type is either a primitive or a boxed primitive.- Parameters:
type- the type to examine- Returns:
- true if the specified type is a primitive or a boxed primitive
-
makePrimitiveBooleanFrom
- Returns:
- A Boolean for an arbitrary object.
-
makeBooleanFrom
-
makePrimitiveIntegerFrom
-
makeIntegerFrom
-
makePrimitiveLongFrom
-
makeLongFrom
-
makePrimitiveFloatFrom
-
makeFloatFrom
-
makePrimitiveDoubleFrom
-
makeDoubleFrom
Returns a Double for an arbitrary object. Uses a semi-intelligent algorithm to create an appropriate Double instance. If the Object argument is a:null value - an appropriate value respecting this parsed element's nullAsZero setting e.g., either null or an 'empty' value. Double - returns the argument as is. Number - the Number's doubleValue(). String - Double.parseDouble( String ) Boolean - a pooled instance of either Double( 0 ) or Double( 1 ) Date - A Double for Date.getTime(). default - A parsed Double for the Object argument's toString() method.
- Returns:
- A Double for an arbitrary object (may return a pooled instance).
-
makeBigDecimalFrom
-
makeBigIntegerFrom
-
makeRationalFrom
-
makeStringFrom
-
makeDateFrom
-
parseDateTime
Produce a date from a string using standard DateFormat parsing.- Throws:
ParseException
-
isDateTime
- Throws:
ParseException
-
formatDate
-
formatTime
-
formatNumber
-
parseNumber
-