public class SimpleType extends TypeBase
JsonSerializable.Base
_bindings, _superClass, _superInterfaces
_asStatic, _class, _hash, _typeHandler, _valueHandler
Modifier | Constructor and Description |
---|---|
protected |
SimpleType(Class<?> cls)
Constructor only used by core Jackson databind functionality;
should never be called by application code.
|
protected |
SimpleType(Class<?> cls,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInts) |
protected |
SimpleType(Class<?> cls,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInts,
int extraHash,
Object valueHandler,
Object typeHandler,
boolean asStatic)
Pass-through constructor used by
ReferenceType . |
protected |
SimpleType(Class<?> cls,
TypeBindings bindings,
JavaType superClass,
JavaType[] superInts,
Object valueHandler,
Object typeHandler,
boolean asStatic) |
protected |
SimpleType(TypeBase base)
Simple copy-constructor, usually used when upgrading/refining a simple type
into more specialized type.
|
Modifier and Type | Method and Description |
---|---|
protected JavaType |
_narrow(Class<?> subclass)
Deprecated.
|
protected String |
buildCanonicalName() |
static SimpleType |
construct(Class<?> cls)
Deprecated.
Since 2.7
|
static SimpleType |
constructUnsafe(Class<?> raw)
Method used by core Jackson classes: NOT to be used by application code:
it does NOT properly handle inspection of super-types, so neither parent
Classes nor implemented Interfaces are accessible with resulting type
instance.
|
boolean |
equals(Object o) |
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 |
hasContentType()
Accessor that allows determining whether
JavaType.getContentType() should
return a non-null value (that is, there is a "content type") or not. |
boolean |
isContainerType() |
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() |
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.
|
JavaType |
withContentTypeHandler(Object h)
Internal method that should not be used by any code outside of
jackson-databind: only used internally by databind.
|
SimpleType |
withContentValueHandler(Object h)
Internal method that should not be used by any code outside of
jackson-databind: only used internally by databind.
|
SimpleType |
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.
|
SimpleType |
withTypeHandler(Object h)
Internal method that should not be used by any code outside of
jackson-databind: only used internally by databind.
|
SimpleType |
withValueHandler(Object h)
Internal method that should not be used by any code outside of
jackson-databind: only used internally by databind.
|
_bogusSuperClass, _classSignature, _hasNTypeParameters, containedType, containedTypeCount, containedTypeName, findSuperType, findTypeParameters, getBindings, getInterfaces, getSuperClass, serialize, serializeWithType, toCanonical
containedTypeOrUnknown, forcedNarrowBy, getContentType, getContentTypeHandler, getContentValueHandler, getErasedSignature, getGenericSignature, getKeyType, getParameterSource, getRawClass, getReferencedType, getTypeHandler, getValueHandler, hasGenericTypes, hasHandlers, hashCode, hasRawClass, hasValueHandler, isAbstract, isArrayType, isCollectionLikeType, isConcrete, isEnumImplType, isEnumType, isFinal, isInterface, isJavaLangObject, isMapLikeType, isPrimitive, isRecordType, isThrowable, isTypeOrSubTypeOf, isTypeOrSuperTypeOf, useStaticType, withHandlersFrom
isReferenceType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTypeName
protected SimpleType(Class<?> cls)
As with other direct construction that by-passes TypeFactory
,
no introspection occurs with respect to super-types; caller must be
aware of consequences if using this method.
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts)
protected SimpleType(TypeBase base)
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts, Object valueHandler, Object typeHandler, boolean asStatic)
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts, int extraHash, Object valueHandler, Object typeHandler, boolean asStatic)
ReferenceType
.public static SimpleType constructUnsafe(Class<?> raw)
NOTE: public only because it is called by ObjectMapper
which is
not in same package
@Deprecated public static SimpleType construct(Class<?> cls)
TypeFactory
's constructType
methods which handle introspection appropriately.
Note that prior to 2.7, method usage was not limited and would typically
have worked acceptably: the problem comes from inability to resolve super-type
information, for which TypeFactory
is needed.
@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 SimpleType withTypeHandler(Object h)
JavaType
This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified type handler assigned.
withTypeHandler
in class JavaType
h
- Handler to pass to new instance createdpublic JavaType withContentTypeHandler(Object h)
JavaType
This mutant factory method 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.
withContentTypeHandler
in class JavaType
h
- Handler to pass to new instance createdpublic SimpleType withValueHandler(Object h)
JavaType
This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified value handler assigned.
withValueHandler
in class JavaType
h
- Handler to pass to new instance createdpublic SimpleType withContentValueHandler(Object h)
JavaType
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.
withContentValueHandler
in class JavaType
h
- Handler to pass to new instance createdpublic SimpleType withStaticTyping()
JavaType
withStaticTyping
in class JavaType
public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)
JavaType
protected String buildCanonicalName()
buildCanonicalName
in class TypeBase
public boolean isContainerType()
isContainerType
in class JavaType
public boolean hasContentType()
JavaType
JavaType.getContentType()
should
return a non-null value (that is, there is a "content type") or not.
True if JavaType.isContainerType()
or ResolvedType.isReferenceType()
return true.hasContentType
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 toCopyright © 2008–2021 FasterXML. All rights reserved.