public class TypeTable extends Object
| Modifier and Type | Field and Description |
|---|---|
MathType |
bigDecimalType
Represents the type java.math.BigDecimal
|
MathType |
bigIntegerType
Represents the type java.math.BigInteger
|
BooleanType |
booleanType
Represents the type boolean.
|
IntegralType |
byteType
Represents the type byte.
|
IntegralType |
charType
Represents the type char.
|
protected ClassLoader |
classLoader
Store class loader for Class.forName lookup
|
FloatingPointType |
doubleType
Represents the type double.
|
static ErrorType |
errorType
Represents the internal error type.
|
FloatingPointType |
floatType
Represents the type float.
|
IntegralType |
intType
Represents the type int.
|
IntegralType |
longType
Represents the type long.
|
protected Model |
model
The model used to access class meta info
|
static NullType |
nullType
Represents the type of null
|
IntegralType |
shortType
Represents the type short.
|
StringType |
stringType
Represents the type java.lang.String.
|
protected Map |
types
The list of actual known types.
|
| Modifier and Type | Method and Description |
|---|---|
Type |
binaryNumericPromotion(Type left,
Type right)
Implements binary numeric promotion as defined in the Java Language Specification section 5.6.2
|
Type |
checkType(Class clazz)
Checks for the type with the specified name.
|
Type |
checkType(String name)
Checks for the type with the specified name.
|
Type |
getAvgReturnType(Type type)
Return JDO QL return type for Avg function for a given type.
|
static TypeTable |
getInstance(ClassLoader classLoader) |
Type |
getMinMaxReturnType(Type type)
Return JDO QL return type for Min/Max function for a given type.
|
Type |
getSumReturnType(Type type)
Return JDO QL return type for Sum function for a given type.
|
boolean |
isBooleanType(Type type)
Returns true if type is boolean or java.lang.Boolean
|
boolean |
isCharType(Type type)
Returns true if type is char or java.lang.Character
|
boolean |
isCollectionType(Type type)
Returns true if type denotes a collection type.
|
boolean |
isDoubleType(Type type)
Returns true if type is double or java.lang.Double
|
boolean |
isFloatingPointType(Type type)
Returns true if type is a floating point type or a Java wrapper
class type wrapping a floating point integral type.
|
boolean |
isIntegralType(Type type)
Returns true if type is an integral type or a Java wrapper class
type wrapping an integral type.
|
boolean |
isIntType(Type type)
Returns true if type is int or java.lang.Integer
|
boolean |
isJavaLangMathType(Type type)
Returns true if type denotes a collection type.
|
boolean |
isNumberType(Type type)
Returns true if type is a NumericType or compatible to java.lang.Number
|
boolean |
isPersistenceCapableType(Type type)
Returns true if type denotes a pertsistence capable class
Note, it returns false for non ClassType values, especially for
NullType and ErrorType.
|
static void |
removeInstance(ClassLoader classLoader) |
Type |
unaryNumericPromotion(Type type)
Implements unray numeric promotion as defined in the Java Language Specification section 5.6.1
|
public static final NullType nullType
public static final ErrorType errorType
public BooleanType booleanType
public IntegralType charType
public IntegralType byteType
public IntegralType shortType
public IntegralType intType
public IntegralType longType
public FloatingPointType floatType
public FloatingPointType doubleType
public StringType stringType
public MathType bigDecimalType
public MathType bigIntegerType
protected Model model
protected ClassLoader classLoader
protected Map types
public static TypeTable getInstance(ClassLoader classLoader)
public static void removeInstance(ClassLoader classLoader)
public Type checkType(String name)
name - the name of the type to be checked.public Type checkType(Class clazz)
clazz - the name of the type to be checked.public Type binaryNumericPromotion(Type left, Type right)
public Type unaryNumericPromotion(Type type)
public boolean isNumberType(Type type)
public boolean isIntegralType(Type type)
public boolean isFloatingPointType(Type type)
public boolean isDoubleType(Type type)
public boolean isIntType(Type type)
public boolean isCharType(Type type)
public boolean isBooleanType(Type type)
public boolean isPersistenceCapableType(Type type)
public boolean isCollectionType(Type type)
public boolean isJavaLangMathType(Type type)
public Type getSumReturnType(Type type)
type - is a number data typepublic Type getAvgReturnType(Type type)
type - is a number data typeCopyright © 2019. All rights reserved.