|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.jackson.map.type.TypeFactory
public class TypeFactory
Class that knows how construct JavaType instances,
given various inputs.
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,JavaType> |
_commonTypeCache
To optimize a common use case, we will use a lookup cache to map straight from raw (type erased) Class instances to matching types, for common simple classes. |
static TypeFactory |
instance
|
| Constructor Summary | |
|---|---|
protected |
TypeFactory()
|
| Method Summary | |
|---|---|
protected JavaType |
_fromArrayType(java.lang.reflect.GenericArrayType type)
|
protected JavaType |
_fromClass(java.lang.Class<?> clz)
|
protected JavaType |
_fromParamType(java.lang.reflect.ParameterizedType type)
This method deals with parameterized types, that is, first class generic classes. |
JavaType |
_fromType(java.lang.reflect.Type type)
Factory method that can be used if type information is passed as Java typing returned from getGenericXxx methods
(usually for a return or argument type). |
protected JavaType |
_fromVariable(java.lang.reflect.TypeVariable<?> type)
|
protected JavaType |
_fromWildcard(java.lang.reflect.WildcardType type)
|
static JavaType |
fromClass(java.lang.Class<?> clz)
Factory method that can be used if only type information available is of type Class. |
static JavaType |
fromType(java.lang.reflect.Type type)
Factory method that can be used if type information is passed as Java typing returned from getGenericXxx methods
(usually for a return or argument type). |
static JavaType |
fromTypeReference(TypeReference<?> ref)
Factory method that can be used if the full generic type has been passed using TypeReference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final TypeFactory instance
protected final java.util.HashMap<java.lang.String,JavaType> _commonTypeCache
| Constructor Detail |
|---|
protected TypeFactory()
| Method Detail |
|---|
public static JavaType fromClass(java.lang.Class<?> clz)
Class. This means that there
will not be generic type information due to type erasure,
but at least it will be possible to recognize array
types and non-typed container types.
And for other types (primitives/wrappers, beans), this
is all that is needed.
public static JavaType fromTypeReference(TypeReference<?> ref)
TypeReference. This only needs to be
done if the root type to bind to is generic; but if so,
it must be done to get proper typing.
public static JavaType fromType(java.lang.reflect.Type type)
getGenericXxx methods
(usually for a return or argument type).
protected JavaType _fromClass(java.lang.Class<?> clz)
public JavaType _fromType(java.lang.reflect.Type type)
getGenericXxx methods
(usually for a return or argument type).
protected JavaType _fromParamType(java.lang.reflect.ParameterizedType type)
protected JavaType _fromArrayType(java.lang.reflect.GenericArrayType type)
protected JavaType _fromVariable(java.lang.reflect.TypeVariable<?> type)
protected JavaType _fromWildcard(java.lang.reflect.WildcardType type)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||