Module org.eclipse.persistence.core
Class BasicTypeHelperImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.BasicTypeHelperImpl
-
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 ObjectbinaryNumericPromotion(Object left, Object right)Implements binary numeric promotion as defined in JLS.ObjectextendedBinaryNumericPromotion(Object left, Object right)Implements binary numeric promotion as defined in JLS extended by wrapper classes, BigDecimal and BigInteger.ObjectgetBigDecimalType()Returns the BigDecimal type representation.ObjectgetBigIntegerType()Returns the BigInteger type representation.ObjectgetBooleanClassType()Returns the Boolean class representation.ObjectgetBooleanType()Returns the boolean type representation.ObjectgetByteClassType()Returns the Byte class representation.ObjectgetByteType()Returns the byte type representation.ObjectgetCharacterClassType()Returns the Character class representation.ObjectgetCharType()Returns the char type representation.ObjectgetDateType()Returns the java.util.Date type representation.ObjectgetDoubleClassType()Returns the type representation of class Double.ObjectgetDoubleType()Returns the double type representation.ObjectgetFloatClassType()Returns the type representation of class Float.ObjectgetFloatType()Returns the float type representation.static BasicTypeHelperImplgetInstance()Gets instance of this classObjectgetIntegerClassType()Returns the Inter class representation.ObjectgetIntType()Returns the int type representation.Class<?>getJavaClass(Object type)Returns the class object of the specified type.ObjectgetLongClassType()Returns the type representation of class Long.ObjectgetLongType()Returns the long type representation.ObjectgetMapEntryType()Returns the type representation of class Map.Entry.ObjectgetObjectType()Returns the Object type representation.protected Class<?>getPrimitiveType(Object wrapper)Returns the primitive for the specified wrapper class.ObjectgetShortClassType()Returns the Short class representation.ObjectgetShortType()Returns the short type representation.ObjectgetSQLDateType()Returns the Date type representation.ObjectgetStringType()Returns the String type representation.ObjectgetTimestampType()Returns the timestamp type representation.ObjectgetTimeType()Returns the Time type representation.StringgetTypeName(Object type)Returns the name of the specified type.protected Class<?>getWrapperClass(Object primitive)Returns the wrapper class for the specified primitive.booleanisAssignableFrom(Object left, Object right)convenience method for java's isAssignableFrom that allows auto-boxing, taking java class or a descriptor as arguments.booleanisBigDecimalType(Object type)booleanisBigIntegerType(Object type)booleanisBooleanType(Object type)Returns true if type is the boolean primitive type or the Boolean wrapper classbooleanisByteType(Object type)Returns true if type is the byte primitive type or the Byte wrapper classbooleanisCharacterType(Object type)Returns true if type is the char primitive type or the Character wrapper classbooleanisDateClass(Object type)booleanisDoubleType(Object type)Returns true if type is the double primitive type or the Double wrapper classbooleanisEnumType(Object type)booleanisFloatingPointType(Object type)Returns true if the specified type represents an floating point type or a wrapper class of an floating point type.booleanisFloatType(Object type)Returns true if type is the float primitive type or the Float wrapper classbooleanisIntegerType(Object type)Returns true if type is the int primitive type or the Integer wrapper classbooleanisIntegralType(Object type)Returns true if the specified type represents an integral type or a wrapper class of an integral type.booleanisIntType(Object type)Returns true if type is the int primitive type or the Integer wrapper classbooleanisLongType(Object type)Returns true if type is the long primitive type or the Long wrapper classbooleanisNumericType(Object type)Returns true if the class is any numeric type.booleanisOrderableType(Object type)Returns true if the specified type denotes an orderable typebooleanisShortType(Object type)Returns true if type is the short primitive type or the Short wrapper classbooleanisStrictlyAssignableFrom(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.booleanisStringType(Object type)Returns true if the specified type represents java.lang.String.booleanisWrapperClass(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.
-
-