Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.dataformat.xml

public Class XmlTypeResolverBuilder

extends StdTypeResolverBuilder
Class Inheritance
Imports
java.io.IOException, java.util.Collection, com.fasterxml.jackson.annotation.JsonTypeInfo, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.jsontype.NamedType, .PolymorphicTypeValidator, .TypeIdResolver, com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver, .MinimalClassNameIdResolver, .StdTypeResolverBuilder, com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.dataformat.xml.util.StaxUtil

Custom specialization of StdTypeResolverBuilder; needed so that type id property name can be modified as necessary to make it legal XML element or attribute name.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static class

Field Summary

Inherited from com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder:
_customIdResolver_defaultImpl_idType_includeAs_requireTypeIdForSubtypes_typeIdVisible_typeProperty

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected static String
decodeXmlClassName(String className)

Helper method for decoding "XML safe" Java class name back into actual class name

protected static String
encodeXmlClassName(String className)

Helper method for encoding regular Java class name in form that can be used as XML element name.

protected TypeIdResolver
idResolver(MapperConfig<?> config, JavaType baseType, PolymorphicTypeValidator subtypeValidator, Collection<NamedType> subtypes, boolean forSer, boolean forDeser)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver.

Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.
public StdTypeResolverBuilder
init(JsonTypeInfo.Id
Which type metadata is used
idType
,
TypeIdResolver
(optional) Custom type id resolver used, if any
idRes
)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.init.

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance.
public StdTypeResolverBuilder
init(JsonTypeInfo.Value
Configuration settings to apply.
settings
,
TypeIdResolver idRes)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.init.

Overrides default com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)

Note

This method is abstract in Jackson 3.0, at the moment of writing.

public StdTypeResolverBuilder
typeProperty(String
Name of JSON property to use for including type information
typeIdPropName
)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.typeProperty.

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).
Inherited from com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder:
_hasTypeResolver_propName_strictTypeIdHandlingallowPrimitiveTypesbuildTypeDeserializerbuildTypeSerializerdefaultImpldefineDefaultImplgetDefaultImplgetTypePropertyinclusionisTypeIdVisiblenoTypeInfoBuilderreportInvalidBaseTypesubTypeValidatortypeIdVisibilityverifyBaseTypeValiditywithDefaultImplwithSettings

Constructor Detail

XmlTypeResolverBuilderback to summary
public XmlTypeResolverBuilder()
XmlTypeResolverBuilderback to summary
public XmlTypeResolverBuilder(JsonTypeInfo.Value settings)

Method Detail

decodeXmlClassNameback to summary
protected static String decodeXmlClassName(String className)

Helper method for decoding "XML safe" Java class name back into actual class name

encodeXmlClassNameback to summary
protected static String encodeXmlClassName(String className)

Helper method for encoding regular Java class name in form that can be used as XML element name.

idResolverback to summary
protected TypeIdResolver idResolver(MapperConfig<?> config, JavaType baseType, PolymorphicTypeValidator subtypeValidator, Collection<NamedType> subtypes, boolean forSer, boolean forDeser)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver.

Doc from com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver.

Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.

Annotations
@Override
initback to summary
public StdTypeResolverBuilder init(JsonTypeInfo.Id idType, TypeIdResolver idRes)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.init.

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance.

Parameters
idType:JsonTypeInfo.Id

Which type metadata is used

idRes:TypeIdResolver

(optional) Custom type id resolver used, if any

Returns:StdTypeResolverBuilder

Resulting builder instance (usually this builder, but not necessarily)

Annotations
@Override
initback to summary
public StdTypeResolverBuilder init(JsonTypeInfo.Value settings, TypeIdResolver idRes)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.init.

Overrides default com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)

Note

This method is abstract in Jackson 3.0, at the moment of writing.

Parameters
settings:JsonTypeInfo.Value

Configuration settings to apply.

Returns:StdTypeResolverBuilder

Resulting builder instance (usually this builder, but not necessarily)

Annotations
@Override
typePropertyback to summary
public StdTypeResolverBuilder typeProperty(String typeIdPropName)

Overrides com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.typeProperty.

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Doc from com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.typeProperty.

Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).

Parameters
typeIdPropName:String

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Name of JSON property to use for including type information

Returns:StdTypeResolverBuilder

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

Annotations
@Override
com.fasterxml.jackson.dataformat.xml back to summary

protected Class XmlTypeResolverBuilder.XmlClassNameIdResolver

extends ClassNameIdResolver
Class Inheritance

Field Summary

Inherited from com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver:
_subTypeValidator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
idFromValue(Object value)

Overrides com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver.idFromValue.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Method called to serialize type of the type of given value as a String to include in serialized JSON content.
public JavaType
Inherited from com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver:
_idFrom_typeFromIdconstructgetDescForKnownTypeIdsgetMechanismidFromValueAndTyperegisterSubtype

Constructor Detail

XmlClassNameIdResolverback to summary
public XmlClassNameIdResolver(JavaType baseType, TypeFactory typeFactory, PolymorphicTypeValidator ptv)

Method Detail

idFromValueback to summary
public String idFromValue(Object value)

Overrides com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver.idFromValue.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Doc from com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Method called to serialize type of the type of given value as a String to include in serialized JSON content.

Annotations
@Override
typeFromIdback to summary
public JavaType typeFromId(DatabindContext context, String id) throws IOException

Overrides com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver.typeFromId.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.typeFromId.

Doc from com.fasterxml.jackson.databind.jsontype.TypeIdResolver.typeFromId.

Method called to resolve type from given type identifier.

Annotations
@Override
com.fasterxml.jackson.dataformat.xml back to summary

protected Class XmlTypeResolverBuilder.XmlMinimalClassNameIdResolver

extends MinimalClassNameIdResolver
Class Inheritance

Field Summary

Inherited from com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver:
_basePackageName_basePackagePrefix

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
idFromValue(Object value)

Overrides com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver.idFromValue.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Method called to serialize type of the type of given value as a String to include in serialized JSON content.
public JavaType
Inherited from com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver:
_typeFromIdconstructgetMechanism

Constructor Detail

XmlMinimalClassNameIdResolverback to summary
public XmlMinimalClassNameIdResolver(JavaType baseType, TypeFactory typeFactory, PolymorphicTypeValidator ptv)

Method Detail

idFromValueback to summary
public String idFromValue(Object value)

Overrides com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver.idFromValue.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Doc from com.fasterxml.jackson.databind.jsontype.TypeIdResolver.idFromValue.

Method called to serialize type of the type of given value as a String to include in serialized JSON content.

Annotations
@Override
typeFromIdback to summary
public JavaType typeFromId(DatabindContext context, String id) throws IOException

Overrides com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver.typeFromId.

Implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver.typeFromId.

Doc from com.fasterxml.jackson.databind.jsontype.TypeIdResolver.typeFromId.

Method called to resolve type from given type identifier.

Annotations
@Override