Class JakartaXmlBindAnnotationModule
java.lang.Object
com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule
- All Implemented Interfaces:
Versioned
Module that can be registered to add support for JAXB annotations.
It does basically equivalent of
objectMapper.setAnnotationIntrospector(...);with combination of
JakartaXmlBindAnnotationIntrospector and existing
default introspector(s) (if any), depending on configuration
(by default, JAXB annotations are used as JakartaXmlBindAnnotationModule.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
Module.SetupContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JakartaXmlBindAnnotationIntrospectorIf the introspector is explicitly set or passed, we'll hold on to that until registration.protected StringValue to pass toJakartaXmlBindAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.protected JsonInclude.IncludeValue to pass toJakartaXmlBindAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.protected JakartaXmlBindAnnotationModule.PriorityPriority to use when registering annotation introspector: default value isJakartaXmlBindAnnotationModule.Priority.PRIMARY. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionMethod that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.setNameUsedForXmlValue(String name) 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.version()Method that returns version of this module.Methods inherited from class com.fasterxml.jackson.databind.Module
getDependencies, getTypeId
-
Field Details
-
_priority
Priority to use when registering annotation introspector: default value isJakartaXmlBindAnnotationModule.Priority.PRIMARY. -
_introspector
If the introspector is explicitly set or passed, we'll hold on to that until registration.- Since:
- 2.7
-
_nonNillableInclusion
Value to pass toJakartaXmlBindAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)if defined and non-null.- Since:
- 2.7
-
_nameUsedForXmlValue
Value to pass toJakartaXmlBindAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)if introspector constructed by the module.- Since:
- 2.12
-
-
Constructor Details
-
JakartaXmlBindAnnotationModule
public JakartaXmlBindAnnotationModule() -
JakartaXmlBindAnnotationModule
- Since:
- 2.7
-
-
Method Details
-
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
Description copied from class:ModuleMethod that returns version of this module. Can be used by Jackson for informational purposes. -
setupModule
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
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
- Since:
- 2.7
-
getNonNillableInclusion
- Since:
- 2.7
-
setNameUsedForXmlValue
- Since:
- 2.12
-
getNameUsedForXmlValue
-