|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.type.JavaType
public abstract class JavaType
Base class for type token classes used both to contain information and as keys for deserializers.
Instances can (only) be constructed by
TypeFactory
.
Field Summary | |
---|---|
protected Class<?> |
_class
This is the nominal type-erased Class that would be close to the type represented (but not exactly type, due to type erasure: type instance may have more information on this). |
protected int |
_hashCode
|
Constructor Summary | |
---|---|
protected |
JavaType(Class<?> clz)
|
Method Summary | |
---|---|
protected void |
_assertSubclass(Class<?> subclass,
Class<?> superClass)
|
protected abstract JavaType |
_narrow(Class<?> subclass)
|
protected JavaType |
_widen(Class<?> superclass)
Default implementation is just to call _narrow(java.lang.Class>) , since
underlying type construction is usually identical |
abstract boolean |
equals(Object o)
|
JavaType |
findVariableType(String name)
Method that can be called to see if this type has generic type binding information for type variables, for given formal type parameter name. |
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 |
getHandler()
Method for accessing handler associated with this type, if any |
JavaType |
getKeyType()
Method for accessing key type for this type, assuming type has such a concept (only Map types do) |
Class<?> |
getRawClass()
|
int |
hashCode()
|
boolean |
hasRawClass(Class<?> clz)
Method that can be used to check whether this type has specified Class as its type erasure. |
boolean |
isAbstract()
|
boolean |
isArrayType()
|
boolean |
isConcrete()
|
abstract boolean |
isContainerType()
|
boolean |
isEnumType()
|
boolean |
isInterface()
|
boolean |
isPrimitive()
|
boolean |
isThrowable()
|
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. |
abstract JavaType |
narrowContentsBy(Class<?> contentClass)
|
void |
setHandler(Object h)
Method for assigning handler to associate with this type; or if null passed, to remove such assignment |
abstract String |
toString()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Class<?> _class
protected int _hashCode
Constructor Detail |
---|
protected JavaType(Class<?> clz)
Method Detail |
---|
public final JavaType narrowBy(Class<?> subclass)
IllegalArgumentException
is thrown.
If class is same as the current raw class, instance itself is
returned.
public final JavaType widenBy(Class<?> superclass)
IllegalArgumentException
is thrown.
If class is same as the current raw class, instance itself is
returned.
protected abstract JavaType _narrow(Class<?> subclass)
protected JavaType _widen(Class<?> superclass)
Default implementation is just to call _narrow(java.lang.Class>)
, since
underlying type construction is usually identical
public abstract JavaType narrowContentsBy(Class<?> contentClass)
public void setHandler(Object h)
public final Class<?> getRawClass()
public final boolean hasRawClass(Class<?> clz)
public abstract boolean isContainerType()
public final boolean isAbstract()
public boolean isConcrete()
public boolean isThrowable()
public final boolean isArrayType()
public final boolean isEnumType()
public final boolean isInterface()
public final boolean isPrimitive()
public JavaType findVariableType(String name)
public JavaType getKeyType()
public JavaType getContentType()
public Object getHandler()
protected void _assertSubclass(Class<?> subclass, Class<?> superClass)
public abstract String toString()
toString
in class Object
public abstract boolean equals(Object o)
equals
in class Object
public final int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |