方法详细资料
withTypeHandler
public abstract JavaType 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.
返回:Newly created type instance从以下版本开始:
1.7
withContentTypeHandler
public abstract JavaType 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.
返回:Newly created type instance从以下版本开始:
1.7
withValueHandler
public JavaType withValueHandler(Object h)
从以下版本开始:
1.9
withContentValueHandler
public JavaType withContentValueHandler(Object h)
从以下版本开始:
1.9
setValueHandler
@Deprecated
public void setValueHandler(Object h)
已过时。 Since 1.9, should not be used; instead, use
withContentTypeHandler and
withContentValueHandler methods.
Method for assigning handler to associate with this type; or
if null passed, to remove such assignment
从以下版本开始:
1.3
narrowBy
public JavaType narrowBy(Class> subclass)
Method that can be called to do a "narrowing" conversions; that is,
to return a type with a raw class that is assignable to the raw
class of this type. If this is not possible, an
IllegalArgumentException is thrown.
If class is same as the current raw class, instance itself is
returned.
forcedNarrowBy
public JavaType forcedNarrowBy(Class> subclass)
More efficient version of narrowBy(java.lang.Class>), called by
internal framework in cases where compatibility checks
are to be skipped.
从以下版本开始:
1.5
widenBy
public JavaType widenBy(Class> superclass)
Method that can be called to do a "widening" conversions; that is,
to return a type with a raw class that could be assigned from this
type.
If such conversion is not possible, an
IllegalArgumentException is thrown.
If class is same as the current raw class, instance itself is
returned.
_narrow
protected abstract JavaType _narrow(Class> subclass)
_widen
protected JavaType _widen(Class> superclass)
Default implementation is just to call _narrow(java.lang.Class>), since
underlying type construction is usually identical
narrowContentsBy
public abstract JavaType narrowContentsBy(Class> contentClass)
widenContentsBy
public abstract JavaType widenContentsBy(Class> contentClass)
从以下版本开始:
1.8
getRawClass
public final Class> getRawClass()
hasRawClass
public final boolean hasRawClass(Class> clz)
Method that can be used to check whether this type has
specified Class as its type erasure. Put another way, returns
true if instantiation of this Type is given (type-erased) Class.
isAbstract
public boolean isAbstract()
isConcrete
public boolean isConcrete()
从以下版本开始:
1.3
isThrowable
public boolean isThrowable()
isArrayType
public boolean isArrayType()
isEnumType
public final boolean isEnumType()
isInterface
public final boolean isInterface()
isPrimitive
public final boolean isPrimitive()
isFinal
public final boolean isFinal()
isContainerType
public abstract boolean isContainerType()
返回:True if type represented is a container type; this includes
array, Map and Collection types.
isCollectionLikeType
public boolean isCollectionLikeType()
返回:True if type is either true Collection type,
or something similar (meaning it has at least one type parameter,
which describes type of contents)从以下版本开始:
1.8
isMapLikeType
public boolean isMapLikeType()
返回:True if type is either true Map type,
or something similar (meaning it has at least two type parameter;
first one describing key type, second value type)从以下版本开始:
1.8
hasGenericTypes
public boolean hasGenericTypes()
Method that can be used to find out if the type directly declares generic
parameters (for its direct super-class and/or super-interfaces).
从以下版本开始:
1.6
getKeyType
public JavaType getKeyType()
Method for accessing key type for this type, assuming type
has such a concept (only Map types do)
getContentType
public 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)
containedTypeCount
public int containedTypeCount()
Method for checking how many contained types this type
has. Contained types are usually generic types, so that
generic Maps have 2 contained types.
从以下版本开始:
1.5
containedType
public JavaType containedType(int index)
Method for accessing definitions of contained ("child")
types.
参数:index - Index of contained type to return
返回:Contained type at index, or null if no such type
exists (no exception thrown)从以下版本开始:
1.5
containedTypeName
public String containedTypeName(int index)
Method for accessing name of type variable in indicated
position. If no name is bound, will use placeholders (derived
from 0-based index); if no type variable or argument exists
with given index, null is returned.
参数:index - Index of contained type to return
返回:Contained type at index, or null if no such type
exists (no exception thrown)从以下版本开始:
1.5
getValueHandler
public T getValueHandler()
Method for accessing value handler associated with this type, if any
从以下版本开始:
1.3
getTypeHandler
public T getTypeHandler()
Method for accessing type handler associated with this type, if any
从以下版本开始:
1.5
toCanonical
public abstract String toCanonical()
Method that can be used to serialize type into form from which
it can be fully deserialized from at a later point (using
TypeFactory from mapper package).
For simple types this is same as calling
Class.getName(), but for structured types it may additionally
contain type information about contents.
从以下版本开始:
1.5
getGenericSignature
public String getGenericSignature()
Method for accessing signature that contains generic
type information, in form compatible with JVM 1.5
as per JLS. It is a superset of getErasedSignature(),
in that generic information can be automatically removed
if necessary (just remove outermost
angle brackets along with content inside)
从以下版本开始:
1.6
getGenericSignature
public abstract StringBuilder getGenericSignature(StringBuilder sb)
参数:sb - StringBuilder to append signature to
返回:StringBuilder that was passed in; returned to allow
call chaining从以下版本开始:
1.6
getErasedSignature
public String getErasedSignature()
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.
从以下版本开始:
1.6
getErasedSignature
public abstract 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.
参数:sb - StringBuilder to append signature to
返回:StringBuilder that was passed in; returned to allow
call chaining从以下版本开始:
1.6
_assertSubclass
protected void _assertSubclass(Class> subclass,
Class> superClass)
toString
public abstract String toString()
equals
public abstract boolean equals(Object o)
hashCode
public final int hashCode()