public interface ICoercionManager extends IService
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCoerce(IType lhsType,
IType rhsType) |
Object |
convertNullAsPrimitive(IType intrType,
boolean isForBoxing)
Converts a null value to a value compatible with the specified primitive type.
|
Object |
convertValue(Object value,
IType intrType) |
ICoercer |
findCoercer(IType lhsType,
IType rhsType,
boolean runtime) |
String |
formatDate(Date value,
String strFormat) |
String |
formatNumber(Double value,
String strFormat) |
String |
formatTime(Date value,
String strFormat) |
boolean |
isDateTime(String str) |
boolean |
isPrimitiveOrBoxed(IType type)
Determine whether the specified type is either a primitive or a boxed primitive.
|
BigDecimal |
makeBigDecimalFrom(Object obj) |
BigInteger |
makeBigIntegerFrom(Object obj) |
Boolean |
makeBooleanFrom(Object obj) |
Date |
makeDateFrom(Object obj)
Returns a new Date instance representing the object.
|
Double |
makeDoubleFrom(Object obj)
Returns a Double for an arbitrary object.
|
Float |
makeFloatFrom(Object obj) |
Integer |
makeIntegerFrom(Object obj) |
Long |
makeLongFrom(Object obj) |
boolean |
makePrimitiveBooleanFrom(Object obj) |
double |
makePrimitiveDoubleFrom(Object obj) |
float |
makePrimitiveFloatFrom(Object obj) |
int |
makePrimitiveIntegerFrom(Object obj) |
long |
makePrimitiveLongFrom(Object obj) |
String |
makeStringFrom(Object obj) |
boolean |
notCoercibleOrRequiresExplicitCoercion(IType lhsType,
IType rhsType) |
Date |
parseDateTime(String str)
Produce a date from a string using standard DateFormat parsing.
|
Number |
parseNumber(String strValue) |
ICoercer |
resolveCoercerStatically(IType lhsType,
IType rhsType)
Determine and return a statically valid coercer from the rhsType to the lhsType.
|
IType |
verifyTypesComparable(IType lhsType,
IType rhsType,
boolean bBiDirectional)
Verifies that the right hand type can be converted or coerced to the left hand type.
|
IType |
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.
|
boolean canCoerce(IType lhsType, IType rhsType)
lhsType - type to be coerced torhsType - type to be coerced fromObject convertValue(Object value, IType intrType)
intrType - type to coerce tovalue - the value to coerce (may not be null)boolean notCoercibleOrRequiresExplicitCoercion(IType lhsType, IType rhsType)
IType verifyTypesComparable(IType lhsType, IType rhsType, boolean bBiDirectional) throws ParseIssue
ParseIssueIType verifyTypesComparable(IType lhsType, IType rhsType, boolean bBiDirectional, IFullParserState parserState) throws ParseIssue
ParseIssueObject convertNullAsPrimitive(IType intrType, boolean isForBoxing)
intrType - The primitive type to convert to.ICoercer resolveCoercerStatically(IType lhsType, IType rhsType)
lhsType - the type to coerce torhsType - the type to coerce fromboolean isPrimitiveOrBoxed(IType type)
type - the type to examineboolean makePrimitiveBooleanFrom(Object obj)
int makePrimitiveIntegerFrom(Object obj)
long makePrimitiveLongFrom(Object obj)
float makePrimitiveFloatFrom(Object obj)
double makePrimitiveDoubleFrom(Object obj)
Double makeDoubleFrom(Object obj)
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.
BigDecimal makeBigDecimalFrom(Object obj)
BigInteger makeBigIntegerFrom(Object obj)
Date parseDateTime(String str) throws ParseException
ParseExceptionboolean isDateTime(String str) throws ParseException
ParseExceptionCopyright © 2019. All rights reserved.