public final class ArrayType extends TypeBase
JavaType
.Modifier and Type | Field and Description |
---|---|
protected JavaType |
_componentType
Type of elements in the array.
|
protected Object |
_emptyArray
We will also keep track of shareable instance of empty array,
since it usually needs to be constructed any way; and because
it is essentially immutable and thus can be shared.
|
_asStatic, _class, _hash, _typeHandler, _valueHandler
Modifier and Type | Method and Description |
---|---|
protected JavaType |
_narrow(Class<?> subclass)
Handling of narrowing conversions for arrays is trickier: for now,
it is not even allowed.
|
protected String |
buildCanonicalName() |
static ArrayType |
construct(JavaType componentType,
Object valueHandler,
Object typeHandler) |
JavaType |
containedType(int index) |
int |
containedTypeCount() |
String |
containedTypeName(int index)
Not sure what symbolic name is used internally, if any;
let's follow naming of Collection types here.
|
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) |
Class<?> |
getParameterSource()
No parameterization for array types themselves; element type
may obviously have parameterization.
|
boolean |
hasGenericTypes() |
boolean |
isAbstract()
For some odd reason, modifiers for array classes would
claim they are abstract types.
|
boolean |
isArrayType() |
boolean |
isConcrete()
For some odd reason, modifiers for array classes would
claim they are abstract types.
|
boolean |
isContainerType() |
JavaType |
narrowContentsBy(Class<?> contentClass)
For array types, both main type and content type can be modified;
but ultimately they are interchangeable.
|
String |
toString() |
JavaType |
widenContentsBy(Class<?> contentClass) |
ArrayType |
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.
|
ArrayType |
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.
|
ArrayType |
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.
|
ArrayType |
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.
|
ArrayType |
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, containedTypeOrUnknown, forcedNarrowBy, getErasedSignature, getGenericSignature, getKeyType, getRawClass, hashCode, hasRawClass, isCollectionLikeType, isEnumType, isFinal, isInterface, isMapLikeType, isPrimitive, isThrowable, narrowBy, useStaticType, widenBy
protected final JavaType _componentType
protected final Object _emptyArray
public static ArrayType construct(JavaType componentType, Object valueHandler, Object typeHandler)
public ArrayType withTypeHandler(Object h)
JavaType
withTypeHandler
in class JavaType
public ArrayType withContentTypeHandler(Object h)
JavaType
withContentTypeHandler
in class JavaType
public ArrayType withValueHandler(Object h)
JavaType
withValueHandler
in class JavaType
public ArrayType withContentValueHandler(Object h)
JavaType
withContentValueHandler
in class JavaType
public ArrayType withStaticTyping()
JavaType
withStaticTyping
in class JavaType
protected String buildCanonicalName()
buildCanonicalName
in class TypeBase
protected JavaType _narrow(Class<?> subclass)
public JavaType narrowContentsBy(Class<?> contentClass)
narrowContentsBy
in class JavaType
public JavaType widenContentsBy(Class<?> contentClass)
widenContentsBy
in class JavaType
public boolean isArrayType()
isArrayType
in class JavaType
public boolean isAbstract()
isAbstract
in class JavaType
public boolean isConcrete()
isConcrete
in class JavaType
public boolean hasGenericTypes()
hasGenericTypes
in class JavaType
public String containedTypeName(int index)
containedTypeName
in class JavaType
public Class<?> getParameterSource()
getParameterSource
in class JavaType
public boolean isContainerType()
isContainerType
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 StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature
in class TypeBase
sb
- StringBuilder to append signature topublic StringBuilder getErasedSignature(StringBuilder sb)
JavaType
getErasedSignature
in class TypeBase
sb
- StringBuilder to append signature toCopyright © 2014-2015 FasterXML. All Rights Reserved.