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.JsonSerializable.Base
Modifier and Type | Field and Description |
---|---|
protected JavaType |
_elementType
Type of elements in collection
|
_bindings, _superClass, _superInterfaces
_asStatic, _class, _hash, _typeHandler, _valueHandler
Modifier | Constructor and Description |
---|---|
protected |
CollectionLikeType(Class<?> collT,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInts,
JavaType elemT,
Object valueHandler,
Object typeHandler,
boolean asStatic) |
protected |
CollectionLikeType(TypeBase base,
JavaType elemT) |
Modifier and Type | Method and Description |
---|---|
protected JavaType |
_narrow(Class<?> subclass)
Deprecated.
|
protected String |
buildCanonicalName() |
static CollectionLikeType |
construct(Class<?> rawType,
JavaType elemT)
Deprecated.
Since 2.7, use
upgradeFrom(com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.JavaType) for constructing instances, given
pre-resolved SimpleType . |
static CollectionLikeType |
construct(Class<?> rawType,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInts,
JavaType elemT) |
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)
|
Object |
getContentTypeHandler() |
Object |
getContentValueHandler() |
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 |
hasHandlers()
Helper method that checks whether this type, or its (optional) key
or content type has
JavaType.getValueHandler() or JavaType.getTypeHandler() ;
that is, are there any non-standard handlers associated with this
type object. |
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 |
refine(Class<?> rawType,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInterfaces)
Mutant factory method that will try to create and return a sub-type instance
for known parameterized types; for other types will return `null` to indicate
that no just refinement makes necessary sense, without trying to detect
special status through implemented interfaces.
|
String |
toString() |
static CollectionLikeType |
upgradeFrom(JavaType baseType,
JavaType elementType)
Factory method that can be used to "upgrade" a basic type into collection-like
one; usually done via
TypeModifier |
JavaType |
withContentType(JavaType contentType)
Mutant factory method that may be called on structured types
that have a so-called content type (element of arrays, value type
of Maps, referenced type of referential types),
and will construct a new instance that is identical to
this instance, except that it has specified content type, instead of current
one.
|
CollectionLikeType |
withContentTypeHandler(Object h)
Mutant factory method that will construct a new instance that is identical to
this instance, except that it will have specified content type (element type
for arrays, value type for Maps and so forth) handler assigned.
|
CollectionLikeType |
withContentValueHandler(Object h)
Mutant factory method that will construct a new instance that is identical to
this instance, except that it will have specified content value handler assigned.
|
JavaType |
withHandlersFrom(JavaType src)
Mutant factory method that will try to copy handlers that the specified
source type instance had, if any; this must be done recursively where
necessary (as content types may be structured).
|
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)
Mutant factory method that will construct a new instance that is identical to
this instance, except that it will have specified value handler assigned.
|
_bogusSuperClass, _classSignature, containedType, containedTypeCount, containedTypeName, findSuperType, findTypeParameters, getBindings, getInterfaces, getSuperClass, serialize, serializeWithType, toCanonical
containedTypeOrUnknown, forcedNarrowBy, getErasedSignature, getGenericSignature, getKeyType, getParameterSource, getRawClass, getReferencedType, getTypeHandler, getValueHandler, hasContentType, hasGenericTypes, hashCode, hasRawClass, hasValueHandler, isAbstract, isArrayType, isConcrete, isEnumType, isFinal, isInterface, isJavaLangObject, isMapLikeType, isPrimitive, isThrowable, isTypeOrSubTypeOf, useStaticType
isReferenceType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTypeName
protected final JavaType _elementType
protected CollectionLikeType(Class<?> collT, TypeBindings bindings, JavaType superClass, JavaType[] superInts, JavaType elemT, Object valueHandler, Object typeHandler, boolean asStatic)
public static CollectionLikeType construct(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInts, JavaType elemT)
@Deprecated public static CollectionLikeType construct(Class<?> rawType, JavaType elemT)
upgradeFrom(com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.JavaType)
for constructing instances, given
pre-resolved SimpleType
.public static CollectionLikeType upgradeFrom(JavaType baseType, JavaType elementType)
TypeModifier
@Deprecated protected JavaType _narrow(Class<?> subclass)
public JavaType withContentType(JavaType contentType)
JavaType
this
is returned.
If type does not have a content type (which is the case with
SimpleType
), IllegalArgumentException
will be thrown.withContentType
in class JavaType
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 JavaType withHandlersFrom(JavaType src)
JavaType
withHandlersFrom
in class JavaType
public CollectionLikeType withStaticTyping()
JavaType
withStaticTyping
in class JavaType
public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)
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()
ResolvedType
getContentType
in class JavaType
public Object getContentValueHandler()
getContentValueHandler
in class JavaType
public Object getContentTypeHandler()
getContentTypeHandler
in class JavaType
public boolean hasHandlers()
JavaType
JavaType.getValueHandler()
or JavaType.getTypeHandler()
;
that is, are there any non-standard handlers associated with this
type object.hasHandlers
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 © 2017 JBoss by Red Hat. All rights reserved.