public class JaxbAnnotationModule extends Module
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).Modifier and Type | Class and Description |
---|---|
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)).
|
Module.SetupContext
Modifier and Type | Field and Description |
---|---|
protected JaxbAnnotationIntrospector |
_introspector
If the introspector is explicitly set or passed, we'll hold on to that
until registration.
|
protected 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 and Description |
---|
JaxbAnnotationModule() |
JaxbAnnotationModule(JaxbAnnotationIntrospector intr) |
Modifier and Type | Method and Description |
---|---|
String |
getModuleName()
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.
|
JsonInclude.Include |
getNonNillableInclusion() |
JaxbAnnotationModule.Priority |
getPriority() |
JaxbAnnotationModule |
setNonNillableInclusion(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(Module.SetupContext context)
Method called by
ObjectMapper when module is registered. |
Version |
version()
Method that returns version of this module.
|
protected JaxbAnnotationModule.Priority _priority
JaxbAnnotationModule.Priority.PRIMARY
.protected JaxbAnnotationIntrospector _introspector
protected JsonInclude.Include _nonNillableInclusion
JaxbAnnotationIntrospector.setNonNillableInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include)
if defined and non-null.public JaxbAnnotationModule()
public JaxbAnnotationModule(JaxbAnnotationIntrospector intr)
public String getModuleName()
Module
getModuleName
in class Module
public Version version()
Module
public void setupModule(Module.SetupContext context)
Module
ObjectMapper
when module is registered.
It is called to let module register functionality it provides,
using callback methods passed-in context object exposes.setupModule
in class Module
public JaxbAnnotationModule setPriority(JaxbAnnotationModule.Priority p)
NOTE: method MUST be called before registering the module -- calling afterwards will not have any effect on previous registrations.
public JaxbAnnotationModule.Priority getPriority()
public JaxbAnnotationModule setNonNillableInclusion(JsonInclude.Include incl)
public JsonInclude.Include getNonNillableInclusion()
Copyright © 2017 JBoss by Red Hat. All rights reserved.