Class BasicTypeHelperImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.BasicTypeHelperImpl
-
- Direct Known Subclasses:
TypeHelperImpl
public class BasicTypeHelperImpl extends Object
INTERNAL This class is a helper class providing type information. Its implementation uses Java reflection to calculate the type information.
-
-
Constructor Summary
Constructors Constructor Description BasicTypeHelperImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
binaryNumericPromotion(Object left, Object right)
Implements binary numeric promotion as defined in JLS.Object
extendedBinaryNumericPromotion(Object left, Object right)
Implements binary numeric promotion as defined in JLS extended by wrapper classes, BigDecimal and BigInteger.Object
getBigDecimalType()
Returns the BigDecimal type representation.Object
getBigIntegerType()
Returns the BigInteger type representation.Object
getBooleanClassType()
Returns the Boolean class representation.Object
getBooleanType()
Returns the boolean type representation.Object
getByteClassType()
Returns the Byte class representation.Object
getByteType()
Returns the byte type representation.Object
getCharacterClassType()
Returns the Character class representation.Object
getCharType()
Returns the char type representation.Object
getDateType()
Returns the java.util.Date type representation.Object
getDoubleClassType()
Returns the type representation of class Double.Object
getDoubleType()
Returns the double type representation.Object
getFloatClassType()
Returns the type representation of class Float.Object
getFloatType()
Returns the float type representation.static BasicTypeHelperImpl
getInstance()
Gets instance of this classObject
getIntegerClassType()
Returns the Inter class representation.Object
getIntType()
Returns the int type representation.Class
getJavaClass(Object type)
Returns the class object of the specified type.Object
getLongClassType()
Returns the type representation of class Long.Object
getLongType()
Returns the long type representation.Object
getMapEntryType()
Returns the type representation of class Map.Entry.Object
getObjectType()
Returns the Object type representation.protected Class
getPrimitiveType(Object wrapper)
Returns the primitive for the specified wrapper class.Object
getShortClassType()
Returns the Short class representation.Object
getShortType()
Returns the short type representation.Object
getSQLDateType()
Returns the Date type representation.Object
getStringType()
Returns the String type representation.Object
getTimestampType()
Returns the timestamp type representation.Object
getTimeType()
Returns the Time type representation.String
getTypeName(Object type)
Returns the name of the specified type.protected Class
getWrapperClass(Object primitive)
Returns the wrapper class for the specified primitive.boolean
isAssignableFrom(Object left, Object right)
convenience method for java's isAssignableFrom that allows auto-boxing, taking java class or a descriptor as arguments.boolean
isBigDecimalType(Object type)
boolean
isBigIntegerType(Object type)
boolean
isBooleanType(Object type)
Returns true if type is the boolean primitive type or the Boolean wrapper classboolean
isByteType(Object type)
Returns true if type is the byte primitive type or the Byte wrapper classboolean
isCharacterType(Object type)
Returns true if type is the char primitive type or the Character wrapper classboolean
isDateClass(Object type)
boolean
isDoubleType(Object type)
Returns true if type is the double primitive type or the Double wrapper classboolean
isEnumType(Object type)
boolean
isFloatingPointType(Object type)
Returns true if the specified type represents an floating point type or a wrapper class of an floating point type.boolean
isFloatType(Object type)
Returns true if type is the float primitive type or the Float wrapper classboolean
isIntegerType(Object type)
Returns true if type is the int primitive type or the Integer wrapper classboolean
isIntegralType(Object type)
Returns true if the specified type represents an integral type or a wrapper class of an integral type.boolean
isIntType(Object type)
Returns true if type is the int primitive type or the Integer wrapper classboolean
isLongType(Object type)
Returns true if type is the long primitive type or the Long wrapper classboolean
isNumericType(Object type)
Returns true if the class is any numeric type.boolean
isOrderableType(Object type)
Returns true if the specified type denotes an orderable typeboolean
isShortType(Object type)
Returns true if type is the short primitive type or the Short wrapper classboolean
isStrictlyAssignableFrom(Object left, Object right)
convenience method for java's isAssignableFrom that allows auto-boxing but follows more closely Java's Class.isAssignableFrom method results, and returns true if either arguments is null.boolean
isStringType(Object type)
Returns true if the specified type represents java.lang.String.boolean
isWrapperClass(Object type)
Returns true if the specified type is a wrapper class.
-
-
-
Method Detail
-
getInstance
public static BasicTypeHelperImpl getInstance()
Gets instance of this class
-
getJavaClass
public Class getJavaClass(Object type)
Returns the class object of the specified type.
-
getObjectType
public Object getObjectType()
Returns the Object type representation.
-
getBooleanType
public Object getBooleanType()
Returns the boolean type representation.
-
getBooleanClassType
public Object getBooleanClassType()
Returns the Boolean class representation.
-
getCharType
public Object getCharType()
Returns the char type representation.
-
getSQLDateType
public Object getSQLDateType()
Returns the Date type representation.
-
getTimeType
public Object getTimeType()
Returns the Time type representation.
-
getTimestampType
public Object getTimestampType()
Returns the timestamp type representation.
-
getCharacterClassType
public Object getCharacterClassType()
Returns the Character class representation.
-
getByteType
public Object getByteType()
Returns the byte type representation.
-
getByteClassType
public Object getByteClassType()
Returns the Byte class representation.
-
getShortType
public Object getShortType()
Returns the short type representation.
-
getShortClassType
public Object getShortClassType()
Returns the Short class representation.
-
getIntType
public Object getIntType()
Returns the int type representation.
-
getIntegerClassType
public Object getIntegerClassType()
Returns the Inter class representation.
-
getLongType
public Object getLongType()
Returns the long type representation.
-
getLongClassType
public Object getLongClassType()
Returns the type representation of class Long.
-
getMapEntryType
public Object getMapEntryType()
Returns the type representation of class Map.Entry.
-
getFloatType
public Object getFloatType()
Returns the float type representation.
-
getFloatClassType
public Object getFloatClassType()
Returns the type representation of class Float.
-
getDoubleType
public Object getDoubleType()
Returns the double type representation.
-
getDoubleClassType
public Object getDoubleClassType()
Returns the type representation of class Double.
-
getStringType
public Object getStringType()
Returns the String type representation.
-
getBigIntegerType
public Object getBigIntegerType()
Returns the BigInteger type representation.
-
getBigDecimalType
public Object getBigDecimalType()
Returns the BigDecimal type representation.
-
getDateType
public Object getDateType()
Returns the java.util.Date type representation.
-
isEnumType
public boolean isEnumType(Object type)
-
isNumericType
public boolean isNumericType(Object type)
Returns true if the class is any numeric type.
-
isIntegralType
public boolean isIntegralType(Object type)
Returns true if the specified type represents an integral type or a wrapper class of an integral type.
-
isFloatingPointType
public boolean isFloatingPointType(Object type)
Returns true if the specified type represents an floating point type or a wrapper class of an floating point type.
-
isWrapperClass
public boolean isWrapperClass(Object type)
Returns true if the specified type is a wrapper class.
-
isBooleanType
public boolean isBooleanType(Object type)
Returns true if type is the boolean primitive type or the Boolean wrapper class
-
isCharacterType
public boolean isCharacterType(Object type)
Returns true if type is the char primitive type or the Character wrapper class
-
isByteType
public boolean isByteType(Object type)
Returns true if type is the byte primitive type or the Byte wrapper class
-
isShortType
public boolean isShortType(Object type)
Returns true if type is the short primitive type or the Short wrapper class
-
isIntType
public boolean isIntType(Object type)
Returns true if type is the int primitive type or the Integer wrapper class
-
isIntegerType
public boolean isIntegerType(Object type)
Returns true if type is the int primitive type or the Integer wrapper class
-
isLongType
public boolean isLongType(Object type)
Returns true if type is the long primitive type or the Long wrapper class
-
isFloatType
public boolean isFloatType(Object type)
Returns true if type is the float primitive type or the Float wrapper class
-
isDoubleType
public boolean isDoubleType(Object type)
Returns true if type is the double primitive type or the Double wrapper class
-
isStringType
public boolean isStringType(Object type)
Returns true if the specified type represents java.lang.String.
-
isDateClass
public boolean isDateClass(Object type)
-
isBigIntegerType
public boolean isBigIntegerType(Object type)
-
isBigDecimalType
public boolean isBigDecimalType(Object type)
-
isOrderableType
public boolean isOrderableType(Object type)
Returns true if the specified type denotes an orderable type
-
isAssignableFrom
public boolean isAssignableFrom(Object left, Object right)
convenience method for java's isAssignableFrom that allows auto-boxing, taking java class or a descriptor as arguments. It will return true if both sides are in the same category (Numberic, Date or Boolean) otherwise it will use java's isAssignableFrom on the argument classes. Returns true if either arguments is null.
-
isStrictlyAssignableFrom
public boolean isStrictlyAssignableFrom(Object left, Object right)
convenience method for java's isAssignableFrom that allows auto-boxing but follows more closely Java's Class.isAssignableFrom method results, and returns true if either arguments is null.
-
extendedBinaryNumericPromotion
public Object extendedBinaryNumericPromotion(Object left, Object right)
Implements binary numeric promotion as defined in JLS extended by wrapper classes, BigDecimal and BigInteger.
-
getPrimitiveType
protected Class getPrimitiveType(Object wrapper)
Returns the primitive for the specified wrapper class.
-
getWrapperClass
protected Class getWrapperClass(Object primitive)
Returns the wrapper class for the specified primitive.
-
-