java.lang.Object
tools.jackson.databind.JacksonModule
tools.jackson.module.jaxb.JaxbAnnotationModule
- All Implemented Interfaces:
tools.jackson.core.Versioned
public class JaxbAnnotationModule
extends tools.jackson.databind.JacksonModule
Module that can be registered to add support for JAXB annotations.
It does basically equivalent of
objectMapper.setAnnotationIntrospector(...);with combination of
JaxbAnnotationIntrospector and existing
default introspector(s) (if any), depending on configuration
(by default, JAXB annotations are used as JaxbAnnotationModule.Priority.PRIMARY
annotations).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration that defines how we use JAXB Annotations: either as "primary" annotations (before any other already configured introspector -- most likely default JacksonAnnotationIntrospector) or as "secondary" annotations (after any other already configured introspector(s)).Nested classes/interfaces inherited from class tools.jackson.databind.JacksonModule
tools.jackson.databind.JacksonModule.SetupContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JaxbAnnotationIntrospectorIf the introspector is explicitly set or passed, we'll hold on to that until registration.protected StringValue to pass toJaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.protected com.fasterxml.jackson.annotation.JsonInclude.IncludeValue to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.protected JaxbAnnotationModule.PriorityPriority to use when registering annotation introspector: default value isJaxbAnnotationModule.Priority.PRIMARY. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.annotation.JsonInclude.IncludesetNameUsedForXmlValue(String name) setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include incl) Method for defining whether JAXB annotations should be added as primary or secondary annotations (compared to already registered annotations).voidsetupModule(tools.jackson.databind.JacksonModule.SetupContext context) tools.jackson.core.Versionversion()Methods inherited from class tools.jackson.databind.JacksonModule
getDependencies, getRegistrationId
-
Field Details
-
_priority
Priority to use when registering annotation introspector: default value isJaxbAnnotationModule.Priority.PRIMARY. -
_introspector
If the introspector is explicitly set or passed, we'll hold on to that until registration. -
_nonNillableInclusion
protected com.fasterxml.jackson.annotation.JsonInclude.Include _nonNillableInclusionValue to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null. -
_nameUsedForXmlValue
Value to pass toJaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.
-
-
Constructor Details
-
JaxbAnnotationModule
public JaxbAnnotationModule() -
JaxbAnnotationModule
-
-
Method Details
-
getModuleName
- Specified by:
getModuleNamein classtools.jackson.databind.JacksonModule
-
version
public tools.jackson.core.Version version()- Specified by:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.databind.JacksonModule
-
setupModule
public void setupModule(tools.jackson.databind.JacksonModule.SetupContext context) - Specified by:
setupModulein classtools.jackson.databind.JacksonModule
-
setPriority
Method for defining whether JAXB annotations should be added as primary or secondary annotations (compared to already registered annotations).NOTE: method MUST be called before registering the module -- calling afterwards will not have any effect on previous registrations.
-
getPriority
-
setNonNillableInclusion
public JaxbAnnotationModule setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include incl) -
getNonNillableInclusion
public com.fasterxml.jackson.annotation.JsonInclude.Include getNonNillableInclusion() -
setNameUsedForXmlValue
- Since:
- 2.12
-
getNameUsedForXmlValue
-