Top Description Fields Constructors Methods
tools.jackson.databind.type

public Class SimpleType

extends TypeBase
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.type.IterationType, tools.jackson.databind.type.ReferenceType
Imports
tools.jackson.databind.JavaType

Simple types are defined as anything other than one of recognized container types (arrays, Collections, Maps). For our needs we need not know anything further, since we have no way of dealing with generic types other than Collections and Maps.

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from tools.jackson.databind.type.TypeBase:
_bindings_canonicalName_superClass_superInterfaces

Constructor Summary

AccessConstructor 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(TypeBase base)

Simple copy-constructor, usually used when upgrading/refining a simple type into more specialized type.

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)

Pass-through constructor used by ReferenceType.

Method Summary

Modifier and TypeMethod and Description
protected String
public 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.

public boolean
equals(Object o)

Implements abstract tools.jackson.databind.JavaType.equals.

Indicates whether some other object is "equal to" this one.

public StringBuilder
getErasedSignature(StringBuilder sb)

Implements abstract tools.jackson.databind.type.TypeBase.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.

public StringBuilder
public boolean
hasContentType()

Overrides tools.jackson.databind.JavaType.hasContentType.

Accessor that allows determining whether getContentType() should return a non-null value (that is, there is a "content type") or not.

public boolean
public JavaType
refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)

Implements abstract tools.jackson.databind.JavaType.refine.

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.

public String
toString()

Implements abstract tools.jackson.databind.JavaType.toString.

Returns a string representation of the object.

public JavaType
withContentType(JavaType contentType)

Implements abstract tools.jackson.databind.JavaType.withContentType.

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.

public JavaType
withContentTypeHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withContentTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.

public SimpleType
withContentValueHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withContentValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.

public SimpleType
withStaticTyping()

Implements abstract tools.jackson.databind.JavaType.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.

public SimpleType
withTypeHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.

public SimpleType
withValueHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.

Inherited from tools.jackson.databind.type.TypeBase:
_classSignature_hasNTypeParameterscontainedTypecontainedTypeCountfindSuperTypefindTypeParametersgetBindingsgetInterfacesgetSuperClassserializeserializeWithTypetoCanonical

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.type.TypeBase.serialVersionUID.

Constructor Detail

SimpleTypeback to summary
protected SimpleType(Class<?> cls)

Constructor only used by core Jackson databind functionality; should never be called by application code.

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.

SimpleTypeback to summary
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts)
SimpleTypeback to summary
protected SimpleType(TypeBase base)

Simple copy-constructor, usually used when upgrading/refining a simple type into more specialized type.

SimpleTypeback to summary
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts, Object valueHandler, Object typeHandler, boolean asStatic)
SimpleTypeback to summary
protected SimpleType(Class<?> cls, TypeBindings bindings, JavaType superClass, JavaType[] superInts, int extraHash, Object valueHandler, Object typeHandler, boolean asStatic)

Pass-through constructor used by ReferenceType.

Since
2.6

Method Detail

buildCanonicalNameback to summary
protected String buildCanonicalName()

Overrides tools.jackson.databind.type.TypeBase.buildCanonicalName.

Annotations
@Override
constructUnsafeback to summary
public 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.

Note

public only because it is called by ObjectMapper which is not in same package

equalsback to summary
public boolean equals(Object o)

Implements abstract tools.jackson.databind.JavaType.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getErasedSignatureback to summary
public StringBuilder getErasedSignature(StringBuilder sb)

Implements abstract tools.jackson.databind.type.TypeBase.getErasedSignature.

Doc from tools.jackson.databind.JavaType.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.

Annotations
@Override
getGenericSignatureback to summary
public StringBuilder getGenericSignature(StringBuilder sb)

Implements abstract tools.jackson.databind.type.TypeBase.getGenericSignature.

Annotations
@Override
hasContentTypeback to summary
public boolean hasContentType()

Overrides tools.jackson.databind.JavaType.hasContentType.

Doc from tools.jackson.databind.JavaType.hasContentType.

Accessor that allows determining whether getContentType() should return a non-null value (that is, there is a "content type") or not. True if isContainerType() or isReferenceType() return true.

Annotations
@Override
isContainerTypeback to summary
public boolean isContainerType()

Implements abstract tools.jackson.databind.JavaType.isContainerType.

Annotations
@Override
refineback to summary
public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)

Implements abstract tools.jackson.databind.JavaType.refine.

Doc from tools.jackson.databind.JavaType.refine.

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.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract tools.jackson.databind.JavaType.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
withContentTypeback to summary
public JavaType withContentType(JavaType contentType)

Implements abstract tools.jackson.databind.JavaType.withContentType.

Doc from tools.jackson.databind.JavaType.withContentType.

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. If content type is already set to given type, this is returned. If type does not have a content type (which is the case with SimpleType), IllegalArgumentException will be thrown.

Annotations
@Override
withContentTypeHandlerback to summary
public JavaType withContentTypeHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withContentTypeHandler.

Doc from tools.jackson.databind.JavaType.withContentTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

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.

Annotations
@Override
withContentValueHandlerback to summary
public SimpleType withContentValueHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withContentValueHandler.

Doc from tools.jackson.databind.JavaType.withContentValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

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.

Annotations
@Override
withStaticTypingback to summary
public SimpleType withStaticTyping()

Implements abstract tools.jackson.databind.JavaType.withStaticTyping.

Doc from tools.jackson.databind.JavaType.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. The main use case is to allow forcing of specific root value serialization type, and specifically in resolving serializers for contained types (element types for arrays, Collections and Maps).

Annotations
@Override
withTypeHandlerback to summary
public SimpleType withTypeHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withTypeHandler.

Doc from tools.jackson.databind.JavaType.withTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified type handler assigned.

Annotations
@Override
withValueHandlerback to summary
public SimpleType withValueHandler(Object h)

Implements abstract tools.jackson.databind.JavaType.withValueHandler.

Doc from tools.jackson.databind.JavaType.withValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified value handler assigned.

Annotations
@Override