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.

Note

Since 2.17, property name cleansing only applied to default names (like "@class" and "@type") but not to explicitly specified ones (where caller presumably knows what to do).

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 String
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.

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

Constructor Detail

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

Method Detail

_propNameback to summary
protected String _propName(String propName, JsonTypeInfo.Id idType)

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

Annotations
@Override
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
com.fasterxml.jackson.dataformat.xml back to summary

protected Class XmlTypeResolverBuilder.XmlClassNameIdResolver

extends ClassNameIdResolver
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
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

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver.serialVersionUID.

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

Modifier and TypeField and Description
private static final long
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

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver.serialVersionUID.

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