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
|
_class, _hashCode, _typeHandler, _valueHandler| Modifier | Constructor and Description |
|---|---|
protected |
CollectionLikeType(Class<?> collT,
JavaType elemT)
Deprecated.
|
protected |
CollectionLikeType(Class<?> collT,
JavaType elemT,
Object valueHandler,
Object typeHandler) |
| 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)
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 use "E" for element type
|
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) |
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) |
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) |
_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, setValueHandler, widenByprotected final JavaType _elementType
@Deprecated protected CollectionLikeType(Class<?> collT, JavaType elemT)
public JavaType narrowContentsBy(Class<?> contentClass)
narrowContentsBy in class JavaTypepublic JavaType widenContentsBy(Class<?> contentClass)
widenContentsBy in class JavaTypepublic static CollectionLikeType construct(Class<?> rawType, JavaType elemT)
public CollectionLikeType withTypeHandler(Object h)
JavaTypewithTypeHandler in class JavaTypepublic CollectionLikeType withContentTypeHandler(Object h)
JavaTypewithContentTypeHandler in class JavaTypepublic CollectionLikeType withValueHandler(Object h)
withValueHandler in class JavaTypepublic CollectionLikeType withContentValueHandler(Object h)
withContentValueHandler in class JavaTypepublic boolean isContainerType()
isContainerType in class JavaTypepublic boolean isCollectionLikeType()
isCollectionLikeType in class JavaTypeCollection type,
or something similar (meaning it has at least one type parameter,
which describes type of contents)public JavaType getContentType()
JavaTypegetContentType in class JavaTypepublic int containedTypeCount()
JavaTypecontainedTypeCount in class JavaTypepublic JavaType containedType(int index)
JavaTypecontainedType in class JavaTypeindex - Index of contained type to returnpublic String containedTypeName(int index)
containedTypeName in class JavaTypeindex - Index of contained type to returnpublic StringBuilder getErasedSignature(StringBuilder sb)
JavaTypegetErasedSignature in class TypeBasesb - StringBuilder to append signature topublic StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature in class TypeBasesb - StringBuilder to append signature toprotected String buildCanonicalName()
buildCanonicalName in class TypeBasepublic boolean isTrueCollectionType()
Collection or just something that acts
like one.