|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.expr.TypeConversionHelper
public class TypeConversionHelper
| Constructor Summary | |
|---|---|
TypeConversionHelper()
|
|
| Method Summary | |
|---|---|
static boolean |
canCastTo(TypeInfo convertedTo,
TypeInfo convertedFrom)
Find out if the type convertedFrom can be widening to
the type convertedTo. |
static boolean |
canConvert(Class convertTo,
Object source)
|
static boolean |
canWideningTo(TypeInfo convertedTo,
TypeInfo convertedFrom)
Find out if the type convertedFrom can be widening to
the type convertedTo. |
static Object |
convertPrimitive(String convertTo,
Object source)
This method converts the source to an instance of
type convertTo if source is a primitive
and convertTo is also a primitive type. |
static Object |
convertPrimitive(TypeInfo convertTo,
Object source)
This method converts the source to an instance of
type convertTo if source is a primitive
and convertTo is also a primitive type. |
static boolean |
exactMatch(TypeInfo convertedTo,
TypeInfo convertedFrom)
Find out if the two types are the same. |
static Class |
getClassForType(String name)
|
static boolean |
isCompatible(TypeRetriever provider,
String convertedTo,
String convertedFrom)
Find out if the type convertedFrom is compatible with
the type convertedTo. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeConversionHelper()
| Method Detail |
|---|
public static boolean isCompatible(TypeRetriever provider,
String convertedTo,
String convertedFrom)
convertedFrom is compatible with
the type convertedTo.
provider - convertedTo - convertedFrom -
public static boolean canCastTo(TypeInfo convertedTo,
TypeInfo convertedFrom)
convertedFrom can be widening to
the type convertedTo. If both are primtive types, then
this method will check if primtive narrowing is possible.
convertedTo - convertedFrom -
public static boolean canWideningTo(TypeInfo convertedTo,
TypeInfo convertedFrom)
convertedFrom can be widening to
the type convertedTo.
convertedTo - convertedFrom -
public static boolean exactMatch(TypeInfo convertedTo,
TypeInfo convertedFrom)
convertedTo - convertedFrom -
public static Object convertPrimitive(TypeInfo convertTo,
Object source)
source to an instance of
type convertTo if source is a primitive
and convertTo is also a primitive type. Otherwise,
this method return the source withou conversion.
convertTo - source -
public static Object convertPrimitive(String convertTo,
Object source)
source to an instance of
type convertTo if source is a primitive
and convertTo is also a primitive type. If the
convertTo is a string and the convertFrom
is a character, then conversion is allowed. Otherwise,
this method return the source without conversion.
convertTo - source -
public static boolean canConvert(Class convertTo,
Object source)
public static Class getClassForType(String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||