com.fasterxml.jackson.module.jaxb

## 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 Classes
`static class` `JaxbAnnotationModule.Priority` 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

Fields
`protected JaxbAnnotationIntrospector` `_introspector` If the introspector is explicitly set or passed, we'll hold on to that until registration.
`protected String` `_nameUsedForXmlValue` Value to pass to `JaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)` if introspector constructed by the module.
`protected com.fasterxml.jackson.annotation.JsonInclude.Include` `_nonNillableInclusion` Value to pass to `JaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)` if defined and non-null.
`protected JaxbAnnotationModule.Priority` `_priority` Priority to use when registering annotation introspector: default value is `JaxbAnnotationModule.Priority.PRIMARY`.

### Constructor Summary

Constructors
Constructor and Description
`JaxbAnnotationModule()`
`JaxbAnnotationModule(JaxbAnnotationIntrospector intr)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getModuleName()`
`String` `getNameUsedForXmlValue()`
`com.fasterxml.jackson.annotation.JsonInclude.Include` `getNonNillableInclusion()`
`JaxbAnnotationModule.Priority` `getPriority()`
`JaxbAnnotationModule` `setNameUsedForXmlValue(String name)`
`JaxbAnnotationModule` `setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include incl)`
`JaxbAnnotationModule` `setPriority(JaxbAnnotationModule.Priority p)` 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _priority

    protected JaxbAnnotationModule.Priority _priority

Priority to use when registering annotation introspector: default value is `JaxbAnnotationModule.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 to `JaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)` if defined and non-null.

Since:
  2.7

#### _nameUsedForXmlValue

    protected String _nameUsedForXmlValue

Value to pass to `JaxbAnnotationIntrospector.setNameUsedForXmlValue(java.lang.String)` if introspector constructed by the module.

Since:
  2.12

### Constructor Detail

#### JaxbAnnotationModule

    public JaxbAnnotationModule()

#### JaxbAnnotationModule

    public JaxbAnnotationModule(JaxbAnnotationIntrospector intr)

Since:
  2.7

### Method Detail

#### getModuleName

    public String getModuleName()

Specified by:
  `getModuleName` in class `com.fasterxml.jackson.databind.Module`

#### version

    public com.fasterxml.jackson.core.Version version()

Specified by:
  `version` in interface `com.fasterxml.jackson.core.Versioned`
Specified by:
  `version` in class `com.fasterxml.jackson.databind.Module`

#### setupModule

    public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)

Specified by:
  `setupModule` in class `com.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

#### setNameUsedForXmlValue

    public JaxbAnnotationModule setNameUsedForXmlValue(String name)

Since:
  2.12

#### getNameUsedForXmlValue

    public String getNameUsedForXmlValue()