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 enum
Enumeration 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 JaxbAnnotationIntrospector
If the introspector is explicitly set or passed, we'll hold on to that until registration.protected String
Value to pass toJaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)
if introspector constructed by the module.protected com.fasterxml.jackson.annotation.JsonInclude.Include
Value to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)
if defined and non-null.protected JaxbAnnotationModule.Priority
Priority to use when registering annotation introspector: default value isJaxbAnnotationModule.Priority.PRIMARY
. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.annotation.JsonInclude.Include
setNameUsedForXmlValue
(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).void
setupModule
(com.fasterxml.jackson.databind.Module.SetupContext context) com.fasterxml.jackson.core.Version
version()
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(com.fasterxml.jackson.annotation.JsonInclude.Include)
if defined and non-null.- Since:
- 2.7
-
_nameUsedForXmlValue
Value to pass toJaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)
if introspector constructed by the module.- Since:
- 2.12
-
-
Constructor Details
-
JaxbAnnotationModule
public JaxbAnnotationModule() -
JaxbAnnotationModule
- Since:
- 2.7
-
-
Method Details
-
getModuleName
- Specified by:
getModuleName
in classcom.fasterxml.jackson.databind.Module
-
version
public com.fasterxml.jackson.core.Version version()- Specified by:
version
in interfacecom.fasterxml.jackson.core.Versioned
- Specified by:
version
in classcom.fasterxml.jackson.databind.Module
-
setupModule
public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context) - Specified by:
setupModule
in 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
-