|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.fieldtype.TypeProvider
ariba.util.fieldtype.PrimitiveTypeProvider
public class PrimitiveTypeProvider
Method Summary | |
---|---|
static ariba.util.fieldtype.PrimitiveTypeProvider.PrimitiveTypeInfo |
getBoxedTypeInfo(TypeInfo info)
|
static java.lang.Class |
getClassForType(java.lang.String name)
|
static TypeInfo |
getCoercedType(TypeInfo first,
TypeInfo second)
Given two numeric types first and second , this
method returns a widened type that can contain both first
and second . |
TypeInfo |
getTypeInfo(java.lang.String name)
Retrieve the TypeInfo given the type name. |
static TypeProvider |
instance()
|
static boolean |
isBoxedType(TypeInfo info)
|
static boolean |
isFloatingPointNumericType(TypeInfo info)
|
static boolean |
isNumericType(java.lang.String name)
|
static boolean |
isNumericType(TypeInfo info)
|
static boolean |
isSimplePrimitiveType(TypeInfo info)
|
static boolean |
isSupportedType(java.lang.String name)
|
static boolean |
isUnboxedPrimitiveType(TypeInfo info)
|
static boolean |
isWideningTypeOf(java.lang.String target,
java.lang.String source)
Check to see if source can be converted to type
target , following the Java widening primitive conversion. |
static boolean |
isWideningTypeOf(TypeInfo target,
TypeInfo source)
Check to see if source can be converted to type
target , following the Java widening primitive conversion. |
Methods inherited from class ariba.util.fieldtype.TypeProvider |
---|
equals, getProviderId |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TypeProvider instance()
public TypeInfo getTypeInfo(java.lang.String name)
TypeRetriever
name
- - fully qualified type name
public static boolean isSupportedType(java.lang.String name)
public static boolean isNumericType(java.lang.String name)
public static java.lang.Class getClassForType(java.lang.String name)
public static boolean isNumericType(TypeInfo info)
public static boolean isFloatingPointNumericType(TypeInfo info)
public static boolean isSimplePrimitiveType(TypeInfo info)
public static boolean isUnboxedPrimitiveType(TypeInfo info)
public static ariba.util.fieldtype.PrimitiveTypeProvider.PrimitiveTypeInfo getBoxedTypeInfo(TypeInfo info)
public static boolean isBoxedType(TypeInfo info)
public static TypeInfo getCoercedType(TypeInfo first, TypeInfo second)
first
and second
, this
method returns a widened type that can contain both first
and second
. The input TypeInfo
can be: TypeInfo
is not numeric, this method will return null.
TypeInfo
are whole numbers, return the larger
of the two types.TypeInfo
are real numbers, return the larger
of the two types.TypeInfo
is real number, then return this real
number type unless (a) the other whole number type is BigInteger (return
BigDecimal), (b) the other whole number type is Integer or Long (return
the larger of Double and the real number type.
first
- - A numeric typesecond
- - A numeric type
TypeInfo
that is wide enough to contain both
numeric types. If one of the types is not numeric, return null. If
one of the types is a boxed type, then the returned result is also
a boxed type.public static boolean isWideningTypeOf(TypeInfo target, TypeInfo source)
source
can be converted to type
target
, following the Java widening primitive conversion.
If target
or source
is a primitive type, it will
first be converted to the equivalent primitive type (boxing) before
the widening conversion applies. This method will also handle
type widening if source
or target
is
BigInteger and BigDecimal. This method does not support subtypes of
boxed types, BigInteger and BigDecimal.target
or source
is not a primitive
type, this method returns false.
target
- - a primitive type or boxed type to be converted to.source
- - a primitive type or boxed type
source
can be converted to target
.
Otherwise, return false.public static boolean isWideningTypeOf(java.lang.String target, java.lang.String source)
source
can be converted to type
target
, following the Java widening primitive conversion.
target
- - a primitive type or boxed type to be converted to.source
- - a primitive type or boxed type
source
can be converted to target
.
Otherwise, return false.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |