org.codehaus.jackson.map.type
Class SimpleType

java.lang.Object
  extended by org.codehaus.jackson.type.JavaType
      extended by org.codehaus.jackson.map.type.SimpleType

public final class SimpleType
extends JavaType

Simple types are defined as anything other than one of recognized container types (arrays, Collections, Maps). For our needs we need not know anything further, since we have no way of dealing with generic types other than Collections and Maps.


Field Summary
static SimpleType TYPE_UNSPECIFIED
          This type token is used if the type is unknown due to type erasure.
static SimpleType TYPE_WILDCARD
          This type token is used if the underlying type is only known as unqualified wildcard ("?").
 
Fields inherited from class org.codehaus.jackson.type.JavaType
_class, _hashCode
 
Method Summary
protected  JavaType _narrow(java.lang.Class<?> subclass)
           
protected static void addCommonTypes(java.util.Map<java.lang.String,JavaType> types)
          Method that can be called to add known simple types into given class-to-type map.
static SimpleType construct(java.lang.Class<?> cls)
           
 boolean equals(java.lang.Object o)
           
 boolean isContainerType()
           
 boolean isFullyTyped()
          Simple types are always fully typed, except for special placeholder types.
 JavaType narrowContentsBy(java.lang.Class<?> subclass)
           
 java.lang.String toString()
           
 
Methods inherited from class org.codehaus.jackson.type.JavaType
_assertSubclass, getRawClass, hashCode, hasRawClass, isAbstract, isArrayType, isEnumType, isInterface, isPrimitive, narrowBy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_UNSPECIFIED

public static final SimpleType TYPE_UNSPECIFIED
This type token is used if the type is unknown due to type erasure.


TYPE_WILDCARD

public static final SimpleType TYPE_WILDCARD
This type token is used if the underlying type is only known as unqualified wildcard ("?").

Method Detail

_narrow

protected JavaType _narrow(java.lang.Class<?> subclass)
Specified by:
_narrow in class JavaType

narrowContentsBy

public JavaType narrowContentsBy(java.lang.Class<?> subclass)
Specified by:
narrowContentsBy in class JavaType

construct

public static SimpleType construct(java.lang.Class<?> cls)

addCommonTypes

protected static void addCommonTypes(java.util.Map<java.lang.String,JavaType> types)
Method that can be called to add known simple types into given class-to-type map.


isFullyTyped

public boolean isFullyTyped()
Simple types are always fully typed, except for special placeholder types. Maintaining this constrain requires that no instances are ever created for Collection/Map types.

Specified by:
isFullyTyped in class JavaType

isContainerType

public boolean isContainerType()
Specified by:
isContainerType in class JavaType
Returns:
True if type represented is a container type; this includes array, Map and Collection types.

toString

public java.lang.String toString()
Specified by:
toString in class JavaType

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in class JavaType