|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.jackson.type.JavaType
org.codehaus.jackson.map.type.TypeBase
org.codehaus.jackson.map.type.MapLikeType
public class MapLikeType
Type that represents Map-like types; things that consist of key/value pairs but that
do not necessarily implement Map, but that do not have enough
introspection functionality to allow for some level of generic handling.
This specifically allows framework to check for configuration and annotation
settings used for Map types, and pass these to custom handlers that may be more
familiar with actual type.
| Field Summary | |
|---|---|
protected JavaType |
_keyType
Type of keys of Map. |
protected JavaType |
_valueType
Type of values of Map. |
| Fields inherited from class org.codehaus.jackson.type.JavaType |
|---|
_class, _hashCode, _typeHandler, _valueHandler |
| Constructor Summary | |
|---|---|
protected |
MapLikeType(Class<?> mapType,
JavaType keyT,
JavaType valueT)
Deprecated. |
protected |
MapLikeType(Class<?> mapType,
JavaType keyT,
JavaType valueT,
Object valueHandler,
Object typeHandler)
|
| Method Summary | |
|---|---|
protected JavaType |
_narrow(Class<?> subclass)
|
protected String |
buildCanonicalName()
|
static MapLikeType |
construct(Class<?> rawType,
JavaType keyT,
JavaType valueT)
|
JavaType |
containedType(int index)
Method for accessing definitions of contained ("child") types. |
int |
containedTypeCount()
Method for checking how many contained types this type has. |
String |
containedTypeName(int index)
Not sure if we should count on this, but type names for core interfaces are "K" and "V" respectively. |
boolean |
equals(Object o)
|
JavaType |
getContentType()
Method for accessing content type of this type, if type has such a thing: simple types do not, structured types do (like arrays, Collections and Maps) |
StringBuilder |
getErasedSignature(StringBuilder sb)
Method for accessing signature without generic type information, in form compatible with all versions of JVM, and specifically used for type descriptions when generating byte code. |
StringBuilder |
getGenericSignature(StringBuilder sb)
|
JavaType |
getKeyType()
Method for accessing key type for this type, assuming type has such a concept (only Map types do) |
boolean |
isContainerType()
|
boolean |
isMapLikeType()
|
boolean |
isTrueMapType()
Method that can be used for checking whether this type is a "real" Collection type; meaning whether it represents a parameterized subtype of Collection or just something that acts
like one. |
JavaType |
narrowContentsBy(Class<?> contentClass)
|
JavaType |
narrowKey(Class<?> keySubclass)
|
String |
toString()
|
JavaType |
widenContentsBy(Class<?> contentClass)
|
JavaType |
widenKey(Class<?> keySubclass)
|
MapLikeType |
withContentTypeHandler(Object h)
"Copy method" that will construct a new instance that is identical to this instance, except that its content type will have specified type handler assigned. |
MapLikeType |
withContentValueHandler(Object h)
|
MapLikeType |
withKeyTypeHandler(Object h)
|
MapLikeType |
withKeyValueHandler(Object h)
|
MapLikeType |
withTypeHandler(Object h)
"Copy method" that will construct a new instance that is identical to this instance, except that it will have specified type handler assigned. |
MapLikeType |
withValueHandler(Object h)
|
| Methods inherited from class org.codehaus.jackson.map.type.TypeBase |
|---|
_classSignature, getTypeHandler, getValueHandler, serialize, serializeWithType, toCanonical |
| Methods inherited from class org.codehaus.jackson.type.JavaType |
|---|
_assertSubclass, _widen, forcedNarrowBy, getErasedSignature, getGenericSignature, getRawClass, hasGenericTypes, hashCode, hasRawClass, isAbstract, isArrayType, isCollectionLikeType, isConcrete, isEnumType, isFinal, isInterface, isPrimitive, isThrowable, narrowBy, setValueHandler, widenBy |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final JavaType _keyType
protected final JavaType _valueType
| Constructor Detail |
|---|
@Deprecated
protected MapLikeType(Class<?> mapType,
JavaType keyT,
JavaType valueT)
protected MapLikeType(Class<?> mapType,
JavaType keyT,
JavaType valueT,
Object valueHandler,
Object typeHandler)
| Method Detail |
|---|
public static MapLikeType construct(Class<?> rawType,
JavaType keyT,
JavaType valueT)
protected JavaType _narrow(Class<?> subclass)
_narrow in class JavaTypepublic JavaType narrowContentsBy(Class<?> contentClass)
narrowContentsBy in class JavaTypepublic JavaType widenContentsBy(Class<?> contentClass)
widenContentsBy in class JavaTypepublic JavaType narrowKey(Class<?> keySubclass)
public JavaType widenKey(Class<?> keySubclass)
public MapLikeType withTypeHandler(Object h)
JavaType
withTypeHandler in class JavaTypepublic MapLikeType withContentTypeHandler(Object h)
JavaType
withContentTypeHandler in class JavaTypepublic MapLikeType withValueHandler(Object h)
withValueHandler in class JavaTypepublic MapLikeType withContentValueHandler(Object h)
withContentValueHandler in class JavaTypeprotected String buildCanonicalName()
buildCanonicalName in class TypeBasepublic boolean isContainerType()
isContainerType in class JavaTypepublic boolean isMapLikeType()
isMapLikeType in class JavaTypeMap type,
or something similar (meaning it has at least two type parameter;
first one describing key type, second value type)public JavaType getKeyType()
JavaType
getKeyType in class JavaTypepublic JavaType getContentType()
JavaType
getContentType in class JavaTypepublic int containedTypeCount()
JavaType
containedTypeCount in class JavaTypepublic JavaType containedType(int index)
JavaType
containedType in class JavaTypeindex - Index of contained type to return
public String containedTypeName(int index)
containedTypeName in class JavaTypeindex - Index of contained type to return
public StringBuilder getErasedSignature(StringBuilder sb)
JavaType
getErasedSignature in class TypeBasesb - StringBuilder to append signature to
public StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature in class TypeBasesb - StringBuilder to append signature to
public MapLikeType withKeyTypeHandler(Object h)
public MapLikeType withKeyValueHandler(Object h)
public boolean isTrueMapType()
Collection or just something that acts
like one.
public String toString()
toString in class JavaTypepublic boolean equals(Object o)
equals in class JavaType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||