|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.jpa.jpql.TypeHelper
public final class TypeHelper
This helper contains methods related to IType
and can perform equivalency checks.
Field Summary | |
---|---|
private IType |
objectType The IType for the Object class. |
private IType |
stringType The IType for the String class. |
private ITypeRepository |
typeRepository The external form of the provider of ITypes . |
private IType |
unknownType The IType representing an unknown type. |
Constructor Summary | |
---|---|
TypeHelper(ITypeRepository typeRepository) Creates a new TypeHelper . |
Method Summary | |
---|---|
IType |
bigDecimal() Retrieves the IType for BigDecimal . |
IType |
bigInteger() Retrieves the IType for BigInteger . |
IType |
booleanType() Retrieves the IType for Boolean . |
IType |
byteType() Retrieves the IType for Byte . |
IType |
collectionType() Retrieves the IType for Collection . |
IType |
convertPrimitive(IType type) Converts the given IType , if it's representing a primitive type, into the class of the same type. |
IType |
dateType() Retrieves the IType for Date . |
IType |
doubleType() Retrieves the IType for Double . |
IType |
enumType() Retrieves the IType for Enum . |
IType |
floatType() Retrieves the IType for Float . |
IType |
getType(java.lang.Class<?> type) Returns the IType of the given Java type. |
IType |
getType(java.lang.String typeName) Retrieves the external class for the given fully qualified class name. |
ITypeRepository |
getTypeRepository() Returns the ITypeRepository used by this helper |
IType |
integerType() Retrieves the IType for Integer . |
boolean |
isBooleanType(IType type) Determines whether the given IType is a Boolean . |
boolean |
isCollectionType(IType type) Determines whether the given IType is an instance of Collection . |
boolean |
isDateType(IType type) Determines whether the given IType is a Date , Timestamp or Calendar . |
boolean |
isEnumType(IType type) Determines whether the given IType is an instance of Enum . |
boolean |
isFloatingType(IType type) Determines whether the given IType is an instance of a floating type, which is either Float , Double , float or double. |
boolean |
isIntegralType(IType type) Determines whether the given IType is an instance of a floating type, which is either Integer , Long , int or float. |
boolean |
isMapType(IType type) Determines whether the given IType is an instance of Map . |
boolean |
isNumericType(IType type) Determines whether the given IType is an instance of Numeric . |
boolean |
isObjectType(IType type) Determines whether the given IType is the external form of Object . |
boolean |
isPrimitiveType(IType type) Determines whether the given IType represents a primitive type. |
boolean |
isStringType(IType type) Determines whether the given IType represents the String class. |
IType |
longType() Retrieves the IType for Long . |
IType |
longType(IType type) Converts the given IType , if it's the primitive long, into the Long type. |
IType |
mapType() Retrieves the IType for Map . |
IType |
numberType() Retrieves the IType for Number . |
IType |
objectType() Retrieves the IType for Object . |
ITypeDeclaration |
objectTypeDeclaration() Returns the ITypeDeclaration for the IType representing the Object class. |
IType |
primitiveBoolean() Retrieves the IType for the primitive boolean. |
IType |
primitiveByte() Retrieves the IType for the primitive byte. |
IType |
primitiveDouble() Retrieves the IType for the primitive double. |
IType |
primitiveFloat() Retrieves the IType for the primitive float. |
IType |
primitiveInteger() Retrieves the IType for the primitive int. |
IType |
primitiveLong() Retrieves the IType for the primitive long. |
IType |
primitiveShort() Retrieves the IType for the primitive short. |
IType |
shortType() Retrieves the IType for Short . |
IType |
stringType() Retrieves the IType for String . |
IType |
timestampType() Retrieves the IType for Timestamp . |
IType |
toBooleanType(IType type) Converts the given IType , if it's the primitive boolean, into the Boolean type. |
IType |
toByteType(IType type) Converts the given IType , if it's the primitive byte, into the Byte type. |
IType |
toDoubleType(IType type) Converts the given IType , if it's the primitive double, into the Double type. |
IType |
toFloatType(IType type) Converts the given IType , if it's the primitive float, into the Float type. |
IType |
toIntegerType(IType type) Converts the given IType , if it's the primitive int, into the Integer type. |
IType |
toShortType(IType type) Converts the given IType , if it's the primitive short, into the Short type. |
IType |
unknownType() Retrieves the IType that represents an unknown type. |
ITypeDeclaration |
unknownTypeDeclaration() Returns the ITypeDeclaration for the IType representing an unknown type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IType objectType
IType
for the Object
class.private IType stringType
IType
for the String
class.private final ITypeRepository typeRepository
ITypes
.private IType unknownType
IType
representing an unknown type.Constructor Detail |
---|
public TypeHelper(ITypeRepository typeRepository)
TypeHelper
.
typeRepository
- The repository used to retrieve the typesMethod Detail |
---|
public IType bigDecimal()
IType
for BigDecimal
.BigDecimal
classpublic IType bigInteger()
IType
for BigInteger
.BigInteger
classpublic IType booleanType()
IType
for Boolean
.Boolean
classpublic IType byteType()
IType
for Byte
.Byte
classpublic IType collectionType()
IType
for Collection
.Collection
classpublic IType convertPrimitive(IType type)
IType
, if it's representing a primitive type, into the class of the same type.type
- Type to possibly convert from the primitive into the classIType
if it's not a primitive type otherwise the primitive type will have been converted into the class of that primitivepublic IType dateType()
IType
for Date
.Date
classpublic IType doubleType()
IType
for Double
.Double
classpublic IType enumType()
IType
for Enum
.Enum
classpublic IType floatType()
IType
for Float
.Float
classpublic IType getType(java.lang.Class<?> type)
IType
of the given Java type.type
- The Java type for which its external form will be returnedIType
representing the given Java typepublic IType getType(java.lang.String typeName)
name
- The fully qualified class name of the class to retrievepublic ITypeRepository getTypeRepository()
ITypeRepository
used by this helperITypes
.public IType integerType()
IType
for Integer
.Integer
classpublic boolean isBooleanType(IType type)
IType
is a Boolean
.type
- The type to check it's assignabilitytrue
if the given IType
is a Boolean
; false
otherwisepublic boolean isCollectionType(IType type)
IType
is an instance of Collection
.type
- The type to check it's assignabilitytrue
if the given IType
is an instance of Collection
; false
otherwisepublic boolean isDateType(IType type)
IType
is a Date
, Timestamp
or Calendar
.type
- The type to check it's assignabilitytrue
if the given IType
is a Date
, Timestamp
or Calendar
public boolean isEnumType(IType type)
IType
is an instance of Enum
.type
- The type to check it's assignabilitytrue
if the given IType
is an instance of Enum
; false
otherwisepublic boolean isFloatingType(IType type)
IType
is an instance of a floating type, which is either Float
, Double
, float or double.type
- The type to check it's assignabilitytrue
if the given IType
is a floating type; false
otherwisepublic boolean isIntegralType(IType type)
IType
is an instance of a floating type, which is either Integer
, Long
, int or float.type
- The type to check it's assignabilitytrue
if the given IType
is a integral type; false
otherwisepublic boolean isMapType(IType type)
IType
is an instance of Map
.type
- The type to check it's assignabilitytrue
if the given IType
is an instance of Map
; false
otherwisepublic boolean isNumericType(IType type)
IType
is an instance of Numeric
.type
- The type to check it's assignabilitytrue
if the given IType
is an instance of Numeric
; false
otherwisepublic boolean isObjectType(IType type)
IType
is the external form of Object
.type
- The type to check it's assignabilitytrue
if the given IType
is the external form of Object
public boolean isPrimitiveType(IType type)
IType
represents a primitive type.type
- The type to check it's assignabilitytrue
if the given IType
represents a primitive; false
otherwisepublic boolean isStringType(IType type)
IType
represents the String
class.type
- The type to check it's assignabilitytrue
if the given IType
represents the String
class; false
otherwisepublic IType longType()
IType
for Long
.Long
classpublic IType longType(IType type)
IType
, if it's the primitive long, into the Long
type.type
- The IType
to possibly convertIType
for the class Long
public IType mapType()
IType
for Map
.Map
classpublic IType numberType()
IType
for Number
.Number
classpublic IType objectType()
IType
for Object
.Object
classpublic ITypeDeclaration objectTypeDeclaration()
ITypeDeclaration
for the IType
representing the Object
class.ITypeDeclaration
of the Object
classpublic IType primitiveBoolean()
IType
for the primitive boolean.public IType primitiveByte()
IType
for the primitive byte.public IType primitiveDouble()
IType
for the primitive double.public IType primitiveFloat()
IType
for the primitive float.public IType primitiveInteger()
IType
for the primitive int.public IType primitiveLong()
IType
for the primitive long.public IType primitiveShort()
IType
for the primitive short.public IType shortType()
IType
for Short
.Short
classpublic IType stringType()
IType
for String
.String
classpublic IType timestampType()
IType
for Timestamp
.Timestamp
classpublic IType toBooleanType(IType type)
IType
, if it's the primitive boolean, into the Boolean
type.type
- The IType
to possibly convertIType
for the class Boolean
public IType toByteType(IType type)
IType
, if it's the primitive byte, into the Byte
type.type
- The IType
to possibly convertIType
for the class Byte
public IType toDoubleType(IType type)
IType
, if it's the primitive double, into the Double
type.type
- The IType
to possibly convertIType
for the class Double
public IType toFloatType(IType type)
IType
, if it's the primitive float, into the Float
type.type
- The IType
to possibly convertIType
for the class Float
public IType toIntegerType(IType type)
IType
, if it's the primitive int, into the Integer
type.type
- The IType
to possibly convertIType
for the class Integer
public IType toShortType(IType type)
IType
, if it's the primitive short, into the Short
type.type
- The IType
to possibly convertIType
for the class Short
public IType unknownType()
IType
that represents an unknown type.public ITypeDeclaration unknownTypeDeclaration()
ITypeDeclaration
for the IType
representing an unknown type.ITypeDeclaration
of the unknown type
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |