Class BasicTypeHelperImpl

  • Direct Known Subclasses:
    TypeHelperImpl

    public class BasicTypeHelperImpl
    extends java.lang.Object
    INTERNAL This class is a helper class providing type information. Its implementation uses Java reflection to calculate the type information.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object binaryNumericPromotion​(java.lang.Object left, java.lang.Object right)
      Implements binary numeric promotion as defined in JLS.
      java.lang.Object extendedBinaryNumericPromotion​(java.lang.Object left, java.lang.Object right)
      Implements binary numeric promotion as defined in JLS extended by wrapper classes, BigDecimal and BigInteger.
      java.lang.Object getBigDecimalType()
      Returns the BigDecimal type representation.
      java.lang.Object getBigIntegerType()
      Returns the BigInteger type representation.
      java.lang.Object getBooleanClassType()
      Returns the Boolean class representation.
      java.lang.Object getBooleanType()
      Returns the boolean type representation.
      java.lang.Object getByteClassType()
      Returns the Byte class representation.
      java.lang.Object getByteType()
      Returns the byte type representation.
      java.lang.Object getCharacterClassType()
      Returns the Character class representation.
      java.lang.Object getCharType()
      Returns the char type representation.
      java.lang.Object getDateType()
      Returns the java.util.Date type representation.
      java.lang.Object getDoubleClassType()
      Returns the type representation of class Double.
      java.lang.Object getDoubleType()
      Returns the double type representation.
      java.lang.Object getFloatClassType()
      Returns the type representation of class Float.
      java.lang.Object getFloatType()
      Returns the float type representation.
      static BasicTypeHelperImpl getInstance()
      Gets instance of this class
      java.lang.Object getIntegerClassType()
      Returns the Inter class representation.
      java.lang.Object getIntType()
      Returns the int type representation.
      java.lang.Class getJavaClass​(java.lang.Object type)
      Returns the class object of the specified type.
      java.lang.Object getLongClassType()
      Returns the type representation of class Long.
      java.lang.Object getLongType()
      Returns the long type representation.
      java.lang.Object getMapEntryType()
      Returns the type representation of class Map.Entry.
      java.lang.Object getObjectType()
      Returns the Object type representation.
      protected java.lang.Class getPrimitiveType​(java.lang.Object wrapper)
      Returns the primitive for the specified wrapper class.
      java.lang.Object getShortClassType()
      Returns the Short class representation.
      java.lang.Object getShortType()
      Returns the short type representation.
      java.lang.Object getSQLDateType()
      Returns the Date type representation.
      java.lang.Object getStringType()
      Returns the String type representation.
      java.lang.Object getTimestampType()
      Returns the timestamp type representation.
      java.lang.Object getTimeType()
      Returns the Time type representation.
      java.lang.String getTypeName​(java.lang.Object type)
      Returns the name of the specified type.
      protected java.lang.Class getWrapperClass​(java.lang.Object primitive)
      Returns the wrapper class for the specified primitive.
      boolean isAssignableFrom​(java.lang.Object left, java.lang.Object right)
      convenience method for java's isAssignableFrom that allows auto-boxing, taking java class or a descriptor as arguments.
      boolean isBigDecimalType​(java.lang.Object type)  
      boolean isBigIntegerType​(java.lang.Object type)  
      boolean isBooleanType​(java.lang.Object type)
      Returns true if type is the boolean primitive type or the Boolean wrapper class
      boolean isByteType​(java.lang.Object type)
      Returns true if type is the byte primitive type or the Byte wrapper class
      boolean isCharacterType​(java.lang.Object type)
      Returns true if type is the char primitive type or the Character wrapper class
      boolean isDateClass​(java.lang.Object type)  
      boolean isDoubleType​(java.lang.Object type)
      Returns true if type is the double primitive type or the Double wrapper class
      boolean isEnumType​(java.lang.Object type)  
      boolean isFloatingPointType​(java.lang.Object type)
      Returns true if the specified type represents an floating point type or a wrapper class of an floating point type.
      boolean isFloatType​(java.lang.Object type)
      Returns true if type is the float primitive type or the Float wrapper class
      boolean isIntegerType​(java.lang.Object type)
      Returns true if type is the int primitive type or the Integer wrapper class
      boolean isIntegralType​(java.lang.Object type)
      Returns true if the specified type represents an integral type or a wrapper class of an integral type.
      boolean isIntType​(java.lang.Object type)
      Returns true if type is the int primitive type or the Integer wrapper class
      boolean isLongType​(java.lang.Object type)
      Returns true if type is the long primitive type or the Long wrapper class
      boolean isNumericType​(java.lang.Object type)
      Returns true if the class is any numeric type.
      boolean isOrderableType​(java.lang.Object type)
      Returns true if the specified type denotes an orderable type
      boolean isShortType​(java.lang.Object type)
      Returns true if type is the short primitive type or the Short wrapper class
      boolean isStrictlyAssignableFrom​(java.lang.Object left, java.lang.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​(java.lang.Object type)
      Returns true if the specified type represents java.lang.String.
      boolean isWrapperClass​(java.lang.Object type)
      Returns true if the specified type is a wrapper class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicTypeHelperImpl

        public BasicTypeHelperImpl()
    • Method Detail

      • getTypeName

        public java.lang.String getTypeName​(java.lang.Object type)
        Returns the name of the specified type.
      • getJavaClass

        public java.lang.Class getJavaClass​(java.lang.Object type)
        Returns the class object of the specified type.
      • getObjectType

        public java.lang.Object getObjectType()
        Returns the Object type representation.
      • getBooleanType

        public java.lang.Object getBooleanType()
        Returns the boolean type representation.
      • getBooleanClassType

        public java.lang.Object getBooleanClassType()
        Returns the Boolean class representation.
      • getCharType

        public java.lang.Object getCharType()
        Returns the char type representation.
      • getSQLDateType

        public java.lang.Object getSQLDateType()
        Returns the Date type representation.
      • getTimeType

        public java.lang.Object getTimeType()
        Returns the Time type representation.
      • getTimestampType

        public java.lang.Object getTimestampType()
        Returns the timestamp type representation.
      • getCharacterClassType

        public java.lang.Object getCharacterClassType()
        Returns the Character class representation.
      • getByteType

        public java.lang.Object getByteType()
        Returns the byte type representation.
      • getByteClassType

        public java.lang.Object getByteClassType()
        Returns the Byte class representation.
      • getShortType

        public java.lang.Object getShortType()
        Returns the short type representation.
      • getShortClassType

        public java.lang.Object getShortClassType()
        Returns the Short class representation.
      • getIntType

        public java.lang.Object getIntType()
        Returns the int type representation.
      • getIntegerClassType

        public java.lang.Object getIntegerClassType()
        Returns the Inter class representation.
      • getLongType

        public java.lang.Object getLongType()
        Returns the long type representation.
      • getLongClassType

        public java.lang.Object getLongClassType()
        Returns the type representation of class Long.
      • getMapEntryType

        public java.lang.Object getMapEntryType()
        Returns the type representation of class Map.Entry.
      • getFloatType

        public java.lang.Object getFloatType()
        Returns the float type representation.
      • getFloatClassType

        public java.lang.Object getFloatClassType()
        Returns the type representation of class Float.
      • getDoubleType

        public java.lang.Object getDoubleType()
        Returns the double type representation.
      • getDoubleClassType

        public java.lang.Object getDoubleClassType()
        Returns the type representation of class Double.
      • getStringType

        public java.lang.Object getStringType()
        Returns the String type representation.
      • getBigIntegerType

        public java.lang.Object getBigIntegerType()
        Returns the BigInteger type representation.
      • getBigDecimalType

        public java.lang.Object getBigDecimalType()
        Returns the BigDecimal type representation.
      • getDateType

        public java.lang.Object getDateType()
        Returns the java.util.Date type representation.
      • isEnumType

        public boolean isEnumType​(java.lang.Object type)
      • isNumericType

        public boolean isNumericType​(java.lang.Object type)
        Returns true if the class is any numeric type.
      • isIntegralType

        public boolean isIntegralType​(java.lang.Object type)
        Returns true if the specified type represents an integral type or a wrapper class of an integral type.
      • isFloatingPointType

        public boolean isFloatingPointType​(java.lang.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​(java.lang.Object type)
        Returns true if the specified type is a wrapper class.
      • isBooleanType

        public boolean isBooleanType​(java.lang.Object type)
        Returns true if type is the boolean primitive type or the Boolean wrapper class
      • isCharacterType

        public boolean isCharacterType​(java.lang.Object type)
        Returns true if type is the char primitive type or the Character wrapper class
      • isByteType

        public boolean isByteType​(java.lang.Object type)
        Returns true if type is the byte primitive type or the Byte wrapper class
      • isShortType

        public boolean isShortType​(java.lang.Object type)
        Returns true if type is the short primitive type or the Short wrapper class
      • isIntType

        public boolean isIntType​(java.lang.Object type)
        Returns true if type is the int primitive type or the Integer wrapper class
      • isIntegerType

        public boolean isIntegerType​(java.lang.Object type)
        Returns true if type is the int primitive type or the Integer wrapper class
      • isLongType

        public boolean isLongType​(java.lang.Object type)
        Returns true if type is the long primitive type or the Long wrapper class
      • isFloatType

        public boolean isFloatType​(java.lang.Object type)
        Returns true if type is the float primitive type or the Float wrapper class
      • isDoubleType

        public boolean isDoubleType​(java.lang.Object type)
        Returns true if type is the double primitive type or the Double wrapper class
      • isStringType

        public boolean isStringType​(java.lang.Object type)
        Returns true if the specified type represents java.lang.String.
      • isDateClass

        public boolean isDateClass​(java.lang.Object type)
      • isBigIntegerType

        public boolean isBigIntegerType​(java.lang.Object type)
      • isBigDecimalType

        public boolean isBigDecimalType​(java.lang.Object type)
      • isOrderableType

        public boolean isOrderableType​(java.lang.Object type)
        Returns true if the specified type denotes an orderable type
      • isAssignableFrom

        public boolean isAssignableFrom​(java.lang.Object left,
                                        java.lang.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​(java.lang.Object left,
                                                java.lang.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 java.lang.Object extendedBinaryNumericPromotion​(java.lang.Object left,
                                                               java.lang.Object right)
        Implements binary numeric promotion as defined in JLS extended by wrapper classes, BigDecimal and BigInteger.
      • getPrimitiveType

        protected java.lang.Class getPrimitiveType​(java.lang.Object wrapper)
        Returns the primitive for the specified wrapper class.
      • getWrapperClass

        protected java.lang.Class getWrapperClass​(java.lang.Object primitive)
        Returns the wrapper class for the specified primitive.
      • binaryNumericPromotion

        protected java.lang.Object binaryNumericPromotion​(java.lang.Object left,
                                                          java.lang.Object right)
        Implements binary numeric promotion as defined in JLS.