public class TypeSupport extends Object
| Modifier and Type | Field and Description |
|---|---|
static Object |
bigDecimalType
Represents the type java.math.BigDecimal.
|
static Object |
bigIntegerType
Represents the type java.math.BigInteger.
|
static Object |
booleanClassType
Represents the wrapper class type boolean.
|
static Object |
booleanType
Represents the primitive type boolean.
|
static Object |
byteClassType
Represents the wrapper class type byte.
|
static Object |
byteType
Represents the primitive type byte.
|
static Object |
characterClassType
Represents the wrapper class type char.
|
static Object |
charType
Represents the primitive type char.
|
protected static Set |
dateTimeTypes
Set of names of date and time types.
|
static Object |
doubleClassType
Represents the wrapper class type double.
|
static Object |
doubleType
Represents the primitive type double.
|
static Object |
errorType
Represents the internal error type.
|
static Object |
floatClassType
Represents the wrapper class type float.
|
static Object |
floatType
Represents the primitive type float.
|
static Object |
integerClassType
Represents the wrapper class type int.
|
static Object |
intType
Represents the primitive type int.
|
static Object |
longClassType
Represents the wrapper class type long.
|
static Object |
longType
Represents the primitive type long.
|
protected com.sun.jdo.api.persistence.model.Model |
model
Meta data access.
|
protected static ResourceBundle |
msgs
I18N support.
|
protected NameMapper |
nameMapper
Name mapping EJB <-> JDO.
|
protected static Set |
numericTypes
Set of names of numeric types.
|
protected static Set |
numericWrapperTypes
Set of names of numeric wrapper classes.
|
static Object |
shortClassType
Represents the wrapper class type short.
|
static Object |
shortType
Represents the primitive type short.
|
static Object |
stringType
Represents the type java.lang.String.
|
| Constructor and Description |
|---|
TypeSupport(com.sun.jdo.api.persistence.model.Model model,
NameMapper nameMapper)
Creates a new TypeSupport using the specified model instance to
access meta data and the specified nameMapper for EJB <-> JDO
name mapping.
|
| Modifier and Type | Method and Description |
|---|---|
static Object |
binaryNumericPromotion(Object left,
Object right)
Implements binary numeric promotion as defined in the
Java Language Specification section 5.6.2
|
String |
getAbstractSchemaForTypeInfo(Object typeInfo)
Returns the typeInfo (the ejb name) for the specified abstract schema.
|
Object |
getAvgReturnType(Object type)
Return JDO QL return type for Avg function for a given type.
|
Object |
getElementType(Object fieldInfo)
Returns the type info of the element type if the specified field info
denotes a collection relationship.
|
Object |
getFieldInfo(Object typeInfo,
String fieldName)
Returns the field info for the specified field of the specified type.
|
Object |
getFieldType(Object typeInfo,
String fieldName)
Returns the type info for the type of the given field.
|
Object |
getMinMaxReturnType(Object type)
Return JDO QL return type for Min/Max function for a given type.
|
String |
getPCForTypeInfo(Object typeInfo)
Gets the name of the persistence-capable class which corresponds to
the specified typeInfo (assuming an ejb name).
|
static Object |
getPrimitiveType(Object type)
Returns the type info for a primitive type.
|
Object |
getSumReturnType(Object type)
Return JDO QL return type for Sum function for a given type.
|
Object |
getTypeInfo(Class clazz)
The method returns a type info by type name by class object.
|
Object |
getTypeInfo(String name)
The method returns a type info by type name.
|
Object |
getTypeInfoForAbstractSchema(String abstractSchema)
Returns the typeInfo (the ejb name) for the specified abstract schema.
|
static String |
getTypeName(Object type)
Returns the type name for a specified type info.
|
static Object |
getWrapperType(Object type)
Returns the type info for a wrapper class type.
|
boolean |
hasLocalInterface(Object typeInfo)
Returns
true if the bean with the specified ejb name
has a local interface. |
boolean |
hasRemoteInterface(Object typeInfo)
Returns
true if the bean with the specified ejb name
has a remote interface. |
static boolean |
isBooleanType(Object type)
Returns
true if type is boolean or java.lang.Boolean |
static boolean |
isCharType(Object type)
Returns
true if type is char or java.lang.Character |
boolean |
isCollectionType(Object type)
Returns
true if type is a collection type. |
boolean |
isCompatibleWith(Object left,
Object right)
Implements type compatibility.
|
boolean |
isDateTimeType(Object type)
Returns
true if type is a date or time type |
static boolean |
isDoubleType(Object type)
Returns
true if type is double or java.lang.Double. |
boolean |
isEjbName(Object typeInfo)
Returns
true if the specified type info denotes an ejb name. |
boolean |
isEjbOrInterfaceName(Object typeInfo)
Returns
true if the specified type info denotes an ejb name
or the name of a local interface or the name of a remote interface. |
static boolean |
isErrorType(Object type)
Returns
true if type denotes the error type. |
static boolean |
isFloatingPointType(Object type)
Returns
true if type is a floating point type or
wrapper class of a floating point type. |
static boolean |
isIntType(Object type)
Returns
true if type is int or java.lang.Integer |
boolean |
isLocalInterface(Object typeInfo)
Returns
true if the specified type info denotes
a local interface. |
boolean |
isLocalInterfaceOfEjb(Object typeInfo,
String ejbName)
Returns
true if the specified type info denotes the
local interface of the bean with the specified ejb name. |
static boolean |
isNumberType(Object type)
Returns
true if type is a NumerType, which means it is either
a numeric primitive or a numeric wrapper class. |
static boolean |
isNumericType(Object type)
Returns
true if type is a primitive numeric type such as
byte, int etc. |
static boolean |
isNumericWrapperType(Object type)
Returns
true if type is a wrapper class of a primitive
numeric type such as java.lang.Byte, java.lang.Integer etc. |
boolean |
isOrderableType(Object type)
Returns
true if type is an orderable type |
boolean |
isRelationship(Object fieldInfo)
Returns
true if the specified field info denotes a
relationship field. |
boolean |
isRemoteInterface(Object typeInfo)
Returns
true if the specified type info denotes
a remote interface. |
boolean |
isRemoteInterfaceOfEjb(Object typeInfo,
String ejbName)
Returns
true if the specified type info denotes the
remote interface of the bean with the specified ejb name. |
static boolean |
isStringType(Object type)
Returns
true if type denotes java.lang.String. |
static Object |
unaryNumericPromotion(Object type)
Implements unray numeric promotion as defined in the
Java Language Specification section 5.6.1
|
public static final Object errorType
public static final Object booleanType
public static final Object byteType
public static final Object shortType
public static final Object charType
public static final Object intType
public static final Object longType
public static final Object floatType
public static final Object doubleType
public static final Object booleanClassType
public static final Object byteClassType
public static final Object shortClassType
public static final Object characterClassType
public static final Object integerClassType
public static final Object longClassType
public static final Object floatClassType
public static final Object doubleClassType
public static final Object stringType
public static final Object bigDecimalType
public static final Object bigIntegerType
protected static final Set numericTypes
protected static final Set numericWrapperTypes
protected static final Set dateTimeTypes
protected com.sun.jdo.api.persistence.model.Model model
protected NameMapper nameMapper
protected static final ResourceBundle msgs
public TypeSupport(com.sun.jdo.api.persistence.model.Model model,
NameMapper nameMapper)
public Object getTypeInfo(String name)
public Object getTypeInfo(Class clazz)
public static boolean isErrorType(Object type)
true if type denotes the error type.public static boolean isBooleanType(Object type)
true if type is boolean or java.lang.Booleanpublic static boolean isCharType(Object type)
true if type is char or java.lang.Characterpublic static boolean isIntType(Object type)
true if type is int or java.lang.Integerpublic static boolean isDoubleType(Object type)
true if type is double or java.lang.Double.public static boolean isNumericType(Object type)
true if type is a primitive numeric type such as
byte, int etc.public static boolean isNumericWrapperType(Object type)
true if type is a wrapper class of a primitive
numeric type such as java.lang.Byte, java.lang.Integer etc.public static boolean isNumberType(Object type)
true if type is a NumerType, which means it is either
a numeric primitive or a numeric wrapper class.public static boolean isFloatingPointType(Object type)
true if type is a floating point type or
wrapper class of a floating point type.public static boolean isStringType(Object type)
true if type denotes java.lang.String.public boolean isCollectionType(Object type)
true if type is a collection type.public boolean isDateTimeType(Object type)
true if type is a date or time typepublic boolean isOrderableType(Object type)
true if type is an orderable typepublic static Object getPrimitiveType(Object type)
errorType if the specified type is not a primitive type.public static Object getWrapperType(Object type)
errorType if the specified type is not a wrapper class type.public static Object binaryNumericPromotion(Object left, Object right)
public static Object unaryNumericPromotion(Object type)
public boolean isCompatibleWith(Object left, Object right)
true
if left is compatible with right. This is equivalent to
rightClass.isAssignableFrom(leftClass).
Note, the method does not support inheritance.public static String getTypeName(Object type)
public Object getTypeInfoForAbstractSchema(String abstractSchema)
public String getAbstractSchemaForTypeInfo(Object typeInfo)
public Object getFieldType(Object typeInfo, String fieldName)
public Object getFieldInfo(Object typeInfo, String fieldName)
isRelationship(java.lang.Object)
and getElementType(java.lang.Object) allow to get details for a given field info.public boolean isRelationship(Object fieldInfo)
true if the specified field info denotes a
relationship field.public Object getElementType(Object fieldInfo)
null.public String getPCForTypeInfo(Object typeInfo)
public boolean isEjbName(Object typeInfo)
true if the specified type info denotes an ejb name.public boolean isEjbOrInterfaceName(Object typeInfo)
true if the specified type info denotes an ejb name
or the name of a local interface or the name of a remote interface.public boolean isRemoteInterfaceOfEjb(Object typeInfo, String ejbName)
true if the specified type info denotes the
remote interface of the bean with the specified ejb name.public boolean isLocalInterfaceOfEjb(Object typeInfo, String ejbName)
true if the specified type info denotes the
local interface of the bean with the specified ejb name.public boolean isRemoteInterface(Object typeInfo)
true if the specified type info denotes
a remote interface.public boolean isLocalInterface(Object typeInfo)
true if the specified type info denotes
a local interface.public boolean hasRemoteInterface(Object typeInfo)
true if the bean with the specified ejb name
has a remote interface.public boolean hasLocalInterface(Object typeInfo)
true if the bean with the specified ejb name
has a local interface.public Object getSumReturnType(Object type)
type - is a number data typepublic Object getAvgReturnType(Object type)
type - is a number data typeCopyright © 2013. All Rights Reserved.