Class JaxbAnnotationModule
java.lang.Object
com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned
public class JaxbAnnotationModule
extends com.fasterxml.jackson.databind.Module
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 com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.Module.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(String)if introspector constructed by the module.protected com.fasterxml.jackson.annotation.JsonInclude.IncludeValue to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(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(com.fasterxml.jackson.databind.Module.SetupContext context) com.fasterxml.jackson.core.Versionversion()Methods inherited from class com.fasterxml.jackson.databind.Module
getDependencies, getTypeId
-
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.- Since:
- 2.7
-
_nonNillableInclusion
protected com.fasterxml.jackson.annotation.JsonInclude.Include _nonNillableInclusionValue to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(JsonInclude.Include)if defined and non-null.- Since:
- 2.7
-
_nameUsedForXmlValue
Value to pass toJaxbAnnotationIntrospector.setNameUsedForXmlValue(String)if introspector constructed by the module.- Since:
- 2.12
-
-
Constructor Details
-
JaxbAnnotationModule
public JaxbAnnotationModule() -
JaxbAnnotationModule
- Since:
- 2.7
-
-
Method Details
-
getModuleName
- Specified by:
getModuleNamein classcom.fasterxml.jackson.databind.Module
-
version
public com.fasterxml.jackson.core.Version version()- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Specified by:
versionin classcom.fasterxml.jackson.databind.Module
-
setupModule
public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context) - Specified by:
setupModulein classcom.fasterxml.jackson.databind.Module
-
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) - Since:
- 2.7
-
getNonNillableInclusion
public com.fasterxml.jackson.annotation.JsonInclude.Include getNonNillableInclusion()- Since:
- 2.7
-
setNameUsedForXmlValue
- Since:
- 2.12
-
getNameUsedForXmlValue
-