Class GenericTypeHelper
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.GenericTypeHelper
-
- All Implemented Interfaces:
ITypeHelper
public class GenericTypeHelper extends java.lang.Object implements ITypeHelper
This generic implementation ofITypeHelperwrapsITypeHelperand delegates the calls to it.- Version:
- 2.4
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Constructor Summary
Constructors Constructor Description GenericTypeHelper(TypeHelper delegate)Creates a newGenericTypeHelper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITypebigDecimal()Retrieves the;@link IType} for;@link BigDecimal}.ITypebigInteger()Retrieves the;@link IType} for;@link BigInteger}.ITypebooleanType()Retrieves the;@link IType} for;@link Boolean}.ITypebyteType()Retrieves the;@link IType} for;@link Byte}.ITypecharacterType()Retrieves the;@link IType} for;@link Character}.ITypecollectionType()Retrieves the;@link IType} for;@link Collection}.ITypeconvertPrimitive(java.lang.Object type)Converts the given;@link IType}, if it's representing a primitive type, into the class of the same type.ITypedateType()Retrieves the;@link IType} for;@link Date}.ITypedoubleType()Retrieves the;@link IType} for;@link Double}.ITypeenumType()Retrieves the;@link IType} for;@link Enum}.ITypefloatType()Retrieves the;@link IType} for;@link Float}.ITypegetType(java.lang.Class<?> type)Returns the;@link IType} of the given Java type.ITypegetType(java.lang.String typeName)Retrieves the external class for the given fully qualified class name.ITypeintegerType()Retrieves the;@link IType} for;@link Integer}.booleanisBooleanType(java.lang.Object type)Determines whether the given;@link IType} is a;@link Boolean}.booleanisCollectionType(java.lang.Object type)Determines whether the given;@link IType} is an instance of;@link Collection}.booleanisDateType(java.lang.Object type)Determines whether the given;@link IType} is a;@link Date},;@link Timestamp} or ;@link Calendar}.booleanisEnumType(java.lang.Object type)Determines whether the given;@link IType} is an instance of;@link Enum}.booleanisFloatingType(java.lang.Object type)Determines whether the given;@link IType} is an instance of a floating type, which is eitherFloat,Double, float or double.booleanisIntegralType(java.lang.Object type)Determines whether the given;@link IType} is an instance of a floating type, which is eitherInteger,Long, int or float.booleanisMapType(java.lang.Object type)Determines whether the given;@link IType} is an instance of;@link Map}.booleanisNumericType(java.lang.Object type)Determines whether the given;@link IType} is an instance of;@link Numeric}.booleanisObjectType(java.lang.Object type)Determines whether the given;@link IType} is the external form of;@link Object}.booleanisPrimitiveType(java.lang.Object type)Determines whether the given;@link IType} represents a primitive type.booleanisStringType(java.lang.Object type)Determines whether the given;@link IType} represents theStringclass.ITypelongType()Retrieves the;@link IType} for;@link Long}.ITypelongType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive long, into theLongtype.ITypemapType()Retrieves the;@link IType} for;@link Map}.ITypenumberType()Retrieves the;@link IType} for;@link Number}.ITypeobjectType()Retrieves the;@link IType} for;@link Object}.ITypeDeclarationobjectTypeDeclaration()Returns the;@link Object } for the;@link IType} representing theObjectclass.ITypeprimitiveBoolean()Retrieves the;@link IType} for the primitive boolean.ITypeprimitiveByte()Retrieves the;@link IType} for the primitive byte.ITypeprimitiveChar()Retrieves the;@link IType} for the primitive char.ITypeprimitiveDouble()Retrieves the;@link IType} for the primitive double.ITypeprimitiveFloat()Retrieves the;@link IType} for the primitive float.ITypeprimitiveInteger()Retrieves the;@link IType} for the primitive int.ITypeprimitiveLong()Retrieves the;@link IType} for the primitive long.ITypeprimitiveShort()Retrieves the;@link IType} for the primitive short.ITypeshortType()Retrieves the;@link IType} for;@link Short}.ITypestringType()Retrieves the;@link IType} for;@link String}.ITypetimestampType()Retrieves the;@link IType} for;@link Timestamp}.ITypetoBooleanType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive boolean, into theBooleantype.ITypetoByteType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive byte, into theBytetype.ITypetoDoubleType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive double, into theDoubletype.ITypetoFloatType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive float, into theFloattype.ITypetoIntegerType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive int, into theIntegertype.ITypetoShortType(java.lang.Object type)Converts the given;@link IType}, if it's the primitive short, into theShorttype.ITypeunknownType()Retrieves the;@link IType} that represents an unknown type.ITypeDeclarationunknownTypeDeclaration()Returns the;@link Object } for the;@link IType} representing an unknown type.
-
-
-
Constructor Detail
-
GenericTypeHelper
public GenericTypeHelper(TypeHelper delegate)
Creates a newGenericTypeHelper.- Parameters:
delegate- TheTypeHelperthat is wrapped by this one and all the calls are delegated to it
-
-
Method Detail
-
bigDecimal
public IType bigDecimal()
Retrieves the;@link IType} for;@link BigDecimal}.- Specified by:
bigDecimalin interfaceITypeHelper- Returns:
- The external form of the
BigDecimalclass
-
bigInteger
public IType bigInteger()
Retrieves the;@link IType} for;@link BigInteger}.- Specified by:
bigIntegerin interfaceITypeHelper- Returns:
- The external form of the
BigIntegerclass
-
booleanType
public IType booleanType()
Retrieves the;@link IType} for;@link Boolean}.- Specified by:
booleanTypein interfaceITypeHelper- Returns:
- The external form of the
Booleanclass
-
byteType
public IType byteType()
Retrieves the;@link IType} for;@link Byte}.- Specified by:
byteTypein interfaceITypeHelper- Returns:
- The external form of the
Byteclass
-
characterType
public IType characterType()
Retrieves the;@link IType} for;@link Character}.- Specified by:
characterTypein interfaceITypeHelper- Returns:
- The external form of the
Characterclass
-
collectionType
public IType collectionType()
Retrieves the;@link IType} for;@link Collection}.- Specified by:
collectionTypein interfaceITypeHelper- Returns:
- The external form of the
Collectionclass
-
convertPrimitive
public IType convertPrimitive(java.lang.Object type)
Converts the given;@link IType}, if it's representing a primitive type, into the class of the same type.- Specified by:
convertPrimitivein interfaceITypeHelper- Parameters:
type- Type to possibly convert from the primitive into the class- Returns:
- The given;@link IType} if it's not a primitive type otherwise the primitive type will have been converted into the class of that primitive
-
dateType
public IType dateType()
Retrieves the;@link IType} for;@link Date}.- Specified by:
dateTypein interfaceITypeHelper- Returns:
- The external form of the
Dateclass
-
doubleType
public IType doubleType()
Retrieves the;@link IType} for;@link Double}.- Specified by:
doubleTypein interfaceITypeHelper- Returns:
- The external form of the
Doubleclass
-
enumType
public IType enumType()
Retrieves the;@link IType} for;@link Enum}.- Specified by:
enumTypein interfaceITypeHelper- Returns:
- The external form of the
Enumclass
-
floatType
public IType floatType()
Retrieves the;@link IType} for;@link Float}.- Specified by:
floatTypein interfaceITypeHelper- Returns:
- The external form of the
Floatclass
-
getType
public IType getType(java.lang.Class<?> type)
Returns the;@link IType} of the given Java type.- Specified by:
getTypein interfaceITypeHelper- Parameters:
type- The Java type for which its external form will be returned- Returns:
- The;@link IType} representing the given Java type
-
getType
public IType getType(java.lang.String typeName)
Retrieves the external class for the given fully qualified class name.- Specified by:
getTypein interfaceITypeHelper- Parameters:
typeName- The fully qualified class name of the class to retrieve- Returns:
- The external form of the class to retrieve
-
integerType
public IType integerType()
Retrieves the;@link IType} for;@link Integer}.- Specified by:
integerTypein interfaceITypeHelper- Returns:
- The external form of the
Integerclass
-
isBooleanType
public boolean isBooleanType(java.lang.Object type)
Determines whether the given;@link IType} is a;@link Boolean}.- Specified by:
isBooleanTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is a;@link Boolean};falseotherwise
-
isCollectionType
public boolean isCollectionType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Collection}.- Specified by:
isCollectionTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is an instance of;@link Collection};falseotherwise
-
isDateType
public boolean isDateType(java.lang.Object type)
Determines whether the given;@link IType} is a;@link Date},;@link Timestamp} or ;@link Calendar}.- Specified by:
isDateTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is a;@link Date},;@link Timestamp} or ;@link Calendar}
-
isEnumType
public boolean isEnumType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Enum}.- Specified by:
isEnumTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is an instance of;@link Enum};falseotherwise
-
isFloatingType
public boolean isFloatingType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of a floating type, which is eitherFloat,Double, float or double.- Specified by:
isFloatingTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is a floating type;falseotherwise
-
isIntegralType
public boolean isIntegralType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of a floating type, which is eitherInteger,Long, int or float.- Specified by:
isIntegralTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is a integral type;falseotherwise
-
isMapType
public boolean isMapType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Map}.- Specified by:
isMapTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is an instance of;@link Map};falseotherwise
-
isNumericType
public boolean isNumericType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Numeric}.- Specified by:
isNumericTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is an instance of;@link Numeric};falseotherwise
-
isObjectType
public boolean isObjectType(java.lang.Object type)
Determines whether the given;@link IType} is the external form of;@link Object}.- Specified by:
isObjectTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} is the external form of;@link Object}
-
isPrimitiveType
public boolean isPrimitiveType(java.lang.Object type)
Determines whether the given;@link IType} represents a primitive type.- Specified by:
isPrimitiveTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} represents a primitive;falseotherwise
-
isStringType
public boolean isStringType(java.lang.Object type)
Determines whether the given;@link IType} represents theStringclass.- Specified by:
isStringTypein interfaceITypeHelper- Parameters:
type- The type to check it's assignability- Returns:
trueif the given;@link IType} represents theStringclass;falseotherwise
-
longType
public IType longType()
Retrieves the;@link IType} for;@link Long}.- Specified by:
longTypein interfaceITypeHelper- Returns:
- The external form of the
Longclass
-
longType
public IType longType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive long, into theLongtype.- Specified by:
longTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive long or the;@link IType} for the class
Long
-
mapType
public IType mapType()
Retrieves the;@link IType} for;@link Map}.- Specified by:
mapTypein interfaceITypeHelper- Returns:
- The external form of the
Mapclass
-
numberType
public IType numberType()
Retrieves the;@link IType} for;@link Number}.- Specified by:
numberTypein interfaceITypeHelper- Returns:
- The external form of the
Numberclass
-
objectType
public IType objectType()
Retrieves the;@link IType} for;@link Object}.- Specified by:
objectTypein interfaceITypeHelper- Returns:
- The external form of the
Objectclass
-
objectTypeDeclaration
public ITypeDeclaration objectTypeDeclaration()
Returns the;@link Object } for the;@link IType} representing theObjectclass.- Specified by:
objectTypeDeclarationin interfaceITypeHelper- Returns:
- The;@link Object } of the
Objectclass
-
primitiveBoolean
public IType primitiveBoolean()
Retrieves the;@link IType} for the primitive boolean.- Specified by:
primitiveBooleanin interfaceITypeHelper- Returns:
- The external form of the primitive boolean
-
primitiveByte
public IType primitiveByte()
Retrieves the;@link IType} for the primitive byte.- Specified by:
primitiveBytein interfaceITypeHelper- Returns:
- The external form of the primitive byte
-
primitiveChar
public IType primitiveChar()
Retrieves the;@link IType} for the primitive char.- Specified by:
primitiveCharin interfaceITypeHelper- Returns:
- The external form of the primitive char
-
primitiveDouble
public IType primitiveDouble()
Retrieves the;@link IType} for the primitive double.- Specified by:
primitiveDoublein interfaceITypeHelper- Returns:
- The external form of the primitive double
-
primitiveFloat
public IType primitiveFloat()
Retrieves the;@link IType} for the primitive float.- Specified by:
primitiveFloatin interfaceITypeHelper- Returns:
- The external form of the primitive float
-
primitiveInteger
public IType primitiveInteger()
Retrieves the;@link IType} for the primitive int.- Specified by:
primitiveIntegerin interfaceITypeHelper- Returns:
- The external form of the primitive int
-
primitiveLong
public IType primitiveLong()
Retrieves the;@link IType} for the primitive long.- Specified by:
primitiveLongin interfaceITypeHelper- Returns:
- The external form of the primitive long
-
primitiveShort
public IType primitiveShort()
Retrieves the;@link IType} for the primitive short.- Specified by:
primitiveShortin interfaceITypeHelper- Returns:
- The external form of the primitive short
-
shortType
public IType shortType()
Retrieves the;@link IType} for;@link Short}.- Specified by:
shortTypein interfaceITypeHelper- Returns:
- The external form of the
Shortclass
-
stringType
public IType stringType()
Retrieves the;@link IType} for;@link String}.- Specified by:
stringTypein interfaceITypeHelper- Returns:
- The external form of the
Stringclass
-
timestampType
public IType timestampType()
Retrieves the;@link IType} for;@link Timestamp}.- Specified by:
timestampTypein interfaceITypeHelper- Returns:
- The external form of the
Timestampclass
-
toBooleanType
public IType toBooleanType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive boolean, into theBooleantype.- Specified by:
toBooleanTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive boolean or the;@link IType} for the class
Boolean
-
toByteType
public IType toByteType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive byte, into theBytetype.- Specified by:
toByteTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive byte or the;@link IType} for the class
Byte
-
toDoubleType
public IType toDoubleType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive double, into theDoubletype.- Specified by:
toDoubleTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive double or the;@link IType} for the class
Double
-
toFloatType
public IType toFloatType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive float, into theFloattype.- Specified by:
toFloatTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive float or the;@link IType} for the class
Float
-
toIntegerType
public IType toIntegerType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive int, into theIntegertype.- Specified by:
toIntegerTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive int or the;@link IType} for the class
Integer
-
toShortType
public IType toShortType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive short, into theShorttype.- Specified by:
toShortTypein interfaceITypeHelper- Parameters:
type- The;@link IType} to possibly convert- Returns:
- The given type if it's not the primitive short or the;@link IType} for the class
Short
-
unknownType
public IType unknownType()
Retrieves the;@link IType} that represents an unknown type.- Specified by:
unknownTypein interfaceITypeHelper- Returns:
- The external form of an unknown type
-
unknownTypeDeclaration
public ITypeDeclaration unknownTypeDeclaration()
Returns the;@link Object } for the;@link IType} representing an unknown type.- Specified by:
unknownTypeDeclarationin interfaceITypeHelper- Returns:
- The;@link Object } of the unknown type
-
-