public class CollectionLikeType extends TypeBase
Collection
;
but may or may not be instances of that interface.
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.Modifier and Type | Field and Description |
---|---|
protected JavaType |
_elementType
Type of elements in collection
|
_asStatic, _class, _hash, _typeHandler, _valueHandler
Modifier | Constructor and Description |
---|---|
protected |
CollectionLikeType(Class<?> collT,
JavaType elemT,
Object valueHandler,
Object typeHandler,
boolean asStatic) |
Modifier and Type | Method and Description |
---|---|
protected JavaType |
_narrow(Class<?> subclass) |
protected String |
buildCanonicalName() |
static CollectionLikeType |
construct(Class<?> rawType,
JavaType elemT) |
JavaType |
containedType(int index) |
int |
containedTypeCount() |
String |
containedTypeName(int index)
Not sure if we should count on this, but type names
for core interfaces use "E" for element type
|
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) |
boolean |
isCollectionLikeType() |
boolean |
isContainerType() |
boolean |
isTrueCollectionType()
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) |
String |
toString() |
JavaType |
widenContentsBy(Class<?> contentClass) |
CollectionLikeType |
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.
|
CollectionLikeType |
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.
|
CollectionLikeType |
withStaticTyping()
Method that can be called to get a type instance that indicates
that values of the type should be handled using "static typing" for purposes
of serialization (as opposed to "dynamic" aka runtime typing):
meaning that no runtime information is needed for determining serializers to use.
|
CollectionLikeType |
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.
|
CollectionLikeType |
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.
|
_classSignature, getTypeHandler, getValueHandler, serialize, serializeWithType, toCanonical
_assertSubclass, _widen, forcedNarrowBy, getErasedSignature, getGenericSignature, getKeyType, getRawClass, hasGenericTypes, hashCode, hasRawClass, isAbstract, isArrayType, isConcrete, isEnumType, isFinal, isInterface, isMapLikeType, isPrimitive, isThrowable, narrowBy, useStaticType, widenBy
protected final JavaType _elementType
public JavaType narrowContentsBy(Class<?> contentClass)
narrowContentsBy
in class JavaType
public JavaType widenContentsBy(Class<?> contentClass)
widenContentsBy
in class JavaType
public static CollectionLikeType construct(Class<?> rawType, JavaType elemT)
public CollectionLikeType withTypeHandler(Object h)
JavaType
withTypeHandler
in class JavaType
public CollectionLikeType withContentTypeHandler(Object h)
JavaType
withContentTypeHandler
in class JavaType
public CollectionLikeType withValueHandler(Object h)
JavaType
withValueHandler
in class JavaType
public CollectionLikeType withContentValueHandler(Object h)
JavaType
withContentValueHandler
in class JavaType
public CollectionLikeType withStaticTyping()
JavaType
withStaticTyping
in class JavaType
public boolean isContainerType()
isContainerType
in class JavaType
public boolean isCollectionLikeType()
isCollectionLikeType
in class JavaType
Collection
type,
or something similar (meaning it has at least one type parameter,
which describes type of contents)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 topublic StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature
in class TypeBase
sb
- StringBuilder to append signature toprotected String buildCanonicalName()
buildCanonicalName
in class TypeBase
public boolean isTrueCollectionType()
Collection
or just something that acts
like one.Copyright © 2014-2015 FasterXML. All Rights Reserved.