Class JakartaXmlBindAnnotationModule
- java.lang.Object
-
- com.fasterxml.jackson.databind.Module
-
- com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule
-
- All Implemented Interfaces:
Versioned
public class JakartaXmlBindAnnotationModule extends Module
Module that can be registered to add support for JAXB annotations. It does basically equivalent ofobjectMapper.setAnnotationIntrospector(...);
with combination ofJakartaXmlBindAnnotationIntrospectorand existing default introspector(s) (if any), depending on configuration (by default, JAXB annotations are used asJakartaXmlBindAnnotationModule.Priority.PRIMARYannotations).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJakartaXmlBindAnnotationModule.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)).-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module
Module.SetupContext
-
-
Field Summary
Fields Modifier and Type Field Description protected JakartaXmlBindAnnotationIntrospector_introspectorIf the introspector is explicitly set or passed, we'll hold on to that until registration.protected String_nameUsedForXmlValueValue to pass toJakartaXmlBindAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.protected JsonInclude.Include_nonNillableInclusionValue to pass toJakartaXmlBindAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.protected JakartaXmlBindAnnotationModule.Priority_priorityPriority to use when registering annotation introspector: default value isJakartaXmlBindAnnotationModule.Priority.PRIMARY.
-
Constructor Summary
Constructors Constructor Description JakartaXmlBindAnnotationModule()JakartaXmlBindAnnotationModule(JakartaXmlBindAnnotationIntrospector intr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetModuleName()Method that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.StringgetNameUsedForXmlValue()JsonInclude.IncludegetNonNillableInclusion()JakartaXmlBindAnnotationModule.PrioritygetPriority()JakartaXmlBindAnnotationModulesetNameUsedForXmlValue(String name)JakartaXmlBindAnnotationModulesetNonNillableInclusion(JsonInclude.Include incl)JakartaXmlBindAnnotationModulesetPriority(JakartaXmlBindAnnotationModule.Priority p)Method for defining whether JAXB annotations should be added as primary or secondary annotations (compared to already registered annotations).voidsetupModule(Module.SetupContext context)Method called byObjectMapperwhen module is registered.Versionversion()Method that returns version of this module.-
Methods inherited from class com.fasterxml.jackson.databind.Module
getDependencies, getTypeId
-
-
-
-
Field Detail
-
_priority
protected JakartaXmlBindAnnotationModule.Priority _priority
Priority to use when registering annotation introspector: default value isJakartaXmlBindAnnotationModule.Priority.PRIMARY.
-
_introspector
protected JakartaXmlBindAnnotationIntrospector _introspector
If the introspector is explicitly set or passed, we'll hold on to that until registration.- Since:
- 2.7
-
_nonNillableInclusion
protected JsonInclude.Include _nonNillableInclusion
Value to pass toJakartaXmlBindAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.- Since:
- 2.7
-
_nameUsedForXmlValue
protected String _nameUsedForXmlValue
Value to pass toJakartaXmlBindAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.- Since:
- 2.12
-
-
Constructor Detail
-
JakartaXmlBindAnnotationModule
public JakartaXmlBindAnnotationModule()
-
JakartaXmlBindAnnotationModule
public JakartaXmlBindAnnotationModule(JakartaXmlBindAnnotationIntrospector intr)
- Since:
- 2.7
-
-
Method Detail
-
getModuleName
public String getModuleName()
Description copied from class:ModuleMethod that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.- Specified by:
getModuleNamein classModule
-
version
public Version version()
Description copied from class:ModuleMethod that returns version of this module. Can be used by Jackson for informational purposes.
-
setupModule
public void setupModule(Module.SetupContext context)
Description copied from class:ModuleMethod called byObjectMapperwhen module is registered. It is called to let module register functionality it provides, using callback methods passed-in context object exposes.- Specified by:
setupModulein classModule
-
setPriority
public JakartaXmlBindAnnotationModule setPriority(JakartaXmlBindAnnotationModule.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 JakartaXmlBindAnnotationModule.Priority getPriority()
-
setNonNillableInclusion
public JakartaXmlBindAnnotationModule setNonNillableInclusion(JsonInclude.Include incl)
- Since:
- 2.7
-
getNonNillableInclusion
public JsonInclude.Include getNonNillableInclusion()
- Since:
- 2.7
-
setNameUsedForXmlValue
public JakartaXmlBindAnnotationModule setNameUsedForXmlValue(String name)
- Since:
- 2.12
-
getNameUsedForXmlValue
public String getNameUsedForXmlValue()
-
-