com.fasterxml.jackson.module.jaxb
Class JaxbAnnotationModule

java.lang.Object
  extended by com.fasterxml.jackson.databind.Module
      extended by com.fasterxml.jackson.databind.module.SimpleModule
          extended by com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

public class JaxbAnnotationModule
extends com.fasterxml.jackson.databind.module.SimpleModule

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).

See Also:
Serialized Form

Nested Class Summary
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
protected  JaxbAnnotationModule.Priority _priority
          Priority to use when registering annotation introspector: default value is JaxbAnnotationModule.Priority.PRIMARY.
 
Fields inherited from class com.fasterxml.jackson.databind.module.SimpleModule
_abstractTypes, _deserializers, _keyDeserializers, _keySerializers, _mixins, _name, _serializers, _subtypes, _valueInstantiators, _version
 
Constructor Summary
JaxbAnnotationModule()
           
 
Method Summary
 JaxbAnnotationModule.Priority getPriority()
           
 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)
           
 
Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule
addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setSerializers, setValueInstantiators, version
 
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.

Constructor Detail

JaxbAnnotationModule

public JaxbAnnotationModule()
Method Detail

setupModule

public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
Overrides:
setupModule in class com.fasterxml.jackson.databind.module.SimpleModule

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()


Copyright © 2012 FasterXML. All Rights Reserved.