|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.core.type.ResolvedType com.fasterxml.jackson.databind.JavaType com.fasterxml.jackson.databind.type.TypeBase com.fasterxml.jackson.databind.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 com.fasterxml.jackson.databind.JavaType |
---|
_class, _hashCode, _typeHandler, _valueHandler |
Constructor Summary | |
---|---|
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)
|
int |
containedTypeCount()
|
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()
|
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()
|
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)
"Copy method" that will construct a new instance that is identical to this instance, except that it will have specified content value handler assigned. |
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)
"Copy method" that will construct a new instance that is identical to this instance, except that it will have specified value handler assigned. |
Methods inherited from class com.fasterxml.jackson.databind.type.TypeBase |
---|
_classSignature, getTypeHandler, getValueHandler, serialize, serializeWithType, toCanonical |
Methods inherited from class com.fasterxml.jackson.databind.JavaType |
---|
_assertSubclass, _widen, forcedNarrowBy, getErasedSignature, getGenericSignature, getRawClass, hasGenericTypes, hashCode, hasRawClass, isAbstract, isArrayType, isCollectionLikeType, isConcrete, isEnumType, isFinal, isInterface, isPrimitive, isThrowable, narrowBy, 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 |
---|
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 JavaType
public JavaType narrowContentsBy(Class<?> contentClass)
narrowContentsBy
in class JavaType
public JavaType widenContentsBy(Class<?> contentClass)
widenContentsBy
in class JavaType
public JavaType narrowKey(Class<?> keySubclass)
public JavaType widenKey(Class<?> keySubclass)
public MapLikeType withTypeHandler(Object h)
JavaType
withTypeHandler
in class JavaType
public MapLikeType withContentTypeHandler(Object h)
JavaType
withContentTypeHandler
in class JavaType
public MapLikeType withValueHandler(Object h)
JavaType
withValueHandler
in class JavaType
public MapLikeType withContentValueHandler(Object h)
JavaType
withContentValueHandler
in class JavaType
protected String buildCanonicalName()
buildCanonicalName
in class TypeBase
public boolean isContainerType()
isContainerType
in class JavaType
public boolean isMapLikeType()
isMapLikeType
in class JavaType
Map
type,
or something similar (meaning it has at least two type parameter;
first one describing key type, second value type)public JavaType getKeyType()
getKeyType
in class JavaType
public JavaType getContentType()
getContentType
in class JavaType
public int containedTypeCount()
containedTypeCount
in class JavaType
public JavaType containedType(int index)
containedType
in class JavaType
public String containedTypeName(int index)
containedTypeName
in class JavaType
public StringBuilder getErasedSignature(StringBuilder sb)
JavaType
getErasedSignature
in class TypeBase
sb
- StringBuilder to append signature to
public StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature
in class TypeBase
sb
- 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 JavaType
public boolean equals(Object o)
equals
in class JavaType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |