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.ModuleModule that can be registered to add support for JAXB annotations. It does basically equivalent ofobjectMapper.setAnnotationIntrospector(...);
with combination ofJaxbAnnotationIntrospectorand existing default introspector(s) (if any), depending on configuration (by default, JAXB annotations are used asJaxbAnnotationModule.Priority.PRIMARYannotations).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJaxbAnnotationModule.PriorityEnumeration 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)).
-
Field Summary
Fields Modifier and Type Field Description protected JaxbAnnotationIntrospector_introspectorIf the introspector is explicitly set or passed, we'll hold on to that until registration.protected com.fasterxml.jackson.annotation.JsonInclude.Include_nonNillableInclusionValue to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.protected JaxbAnnotationModule.Priority_priorityPriority to use when registering annotation introspector: default value isJaxbAnnotationModule.Priority.PRIMARY.
-
Constructor Summary
Constructors Constructor Description JaxbAnnotationModule()JaxbAnnotationModule(JaxbAnnotationIntrospector intr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetModuleName()com.fasterxml.jackson.annotation.JsonInclude.IncludegetNonNillableInclusion()JaxbAnnotationModule.PrioritygetPriority()JaxbAnnotationModulesetNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include incl)JaxbAnnotationModulesetPriority(JaxbAnnotationModule.Priority p)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()
-
-
-
Field Detail
-
_priority
protected JaxbAnnotationModule.Priority _priority
Priority to use when registering annotation introspector: default value isJaxbAnnotationModule.Priority.PRIMARY.
-
_introspector
protected JaxbAnnotationIntrospector _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 _nonNillableInclusion
Value to pass toJaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.- Since:
- 2.7
-
-
Constructor Detail
-
JaxbAnnotationModule
public JaxbAnnotationModule()
-
JaxbAnnotationModule
public JaxbAnnotationModule(JaxbAnnotationIntrospector intr)
- Since:
- 2.7
-
-
Method Detail
-
getModuleName
public java.lang.String 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
public JaxbAnnotationModule setPriority(JaxbAnnotationModule.Priority p)
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
public JaxbAnnotationModule.Priority 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
-
-