Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Jackson JAXB Annotations Source Code
Jackson JAXB Annotations Source Code files are provided in the source packge (jackson-module-jaxb-annotations-2.14.0-sources.jar). You can download it at Jackson Base module Maven Website.
You can also browse Jackson JAXB Annotations Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/module/jaxb/JaxbAnnotationModule.java
package com.fasterxml.jackson.module.jaxb;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.Version;
/**
* Module that can be registered to add support for JAXB annotations.
* It does basically equivalent of
*<pre>
* objectMapper.setAnnotationIntrospector(...);
*</pre>
* with combination of {@link JaxbAnnotationIntrospector} and existing
* default introspector(s) (if any), depending on configuration
* (by default, JAXB annotations are used as {@link Priority#PRIMARY}
* annotations).
*/
public class JaxbAnnotationModule extends com.fasterxml.jackson.databind.Module
{
/**
* 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)).
*<p>
* Default choice is <b>PRIMARY</b>
*<p>
* Note that if you want to use JAXB annotations as the only annotations,
* you must directly set annotation introspector by calling
* {@link com.fasterxml.jackson.databind.ObjectMapper#setAnnotationIntrospector}.
*/
public enum Priority {
PRIMARY, SECONDARY;
}
/**
* Priority to use when registering annotation introspector: default
* value is {@link Priority#PRIMARY}.
*/
protected Priority _priority = Priority.PRIMARY;
/**
* If the introspector is explicitly set or passed, we'll hold on to that
* until registration.
*
* @since 2.7
*/
protected JaxbAnnotationIntrospector _introspector;
/**
* Value to pass to
* {@link JaxbAnnotationIntrospector#setNonNillableInclusion}
* if defined and non-null.
*
* @since 2.7
*/
protected JsonInclude.Include _nonNillableInclusion;
/**
* Value to pass to
* {@link JaxbAnnotationIntrospector#setNameUsedForXmlValue}
* if introspector constructed by the module.
*
* @since 2.12
*/
protected String _nameUsedForXmlValue = JaxbAnnotationIntrospector.DEFAULT_NAME_FOR_XML_VALUE;
/*
/**********************************************************
/* Life cycle
/**********************************************************
*/
public JaxbAnnotationModule() { }
/**
* @since 2.7
*/
public JaxbAnnotationModule(JaxbAnnotationIntrospector intr) {
_introspector = intr;
}
@Override
public String getModuleName() {
return getClass().getSimpleName();
}
@Override
public Version version() {
return PackageVersion.VERSION;
}
@Override
public void setupModule(SetupContext context)
{
JaxbAnnotationIntrospector intr = _introspector;
if (intr == null) {
intr = new JaxbAnnotationIntrospector(context.getTypeFactory());
if (_nonNillableInclusion != null) {
intr.setNonNillableInclusion(_nonNillableInclusion);
}
intr.setNameUsedForXmlValue(_nameUsedForXmlValue);
}
switch (_priority) {
case PRIMARY:
context.insertAnnotationIntrospector(intr);
break;
case SECONDARY:
context.appendAnnotationIntrospector(intr);
break;
}
}
/*
/**********************************************************
/* Configuration
/**********************************************************
*/
/**
* Method for defining whether JAXB annotations should be added
* as primary or secondary annotations (compared to already registered
* annotations).
*<p>
* NOTE: method MUST be called before registering the module -- calling
* afterwards will not have any effect on previous registrations.
*/
public JaxbAnnotationModule setPriority(Priority p) {
_priority = p;
return this;
}
public Priority getPriority() { return _priority; }
/**
* @since 2.7
*/
public JaxbAnnotationModule setNonNillableInclusion(JsonInclude.Include incl) {
_nonNillableInclusion = incl;
if (_introspector != null) {
// 13-Nov-2020, tatu: should we pass null "incl"?
_introspector.setNonNillableInclusion(incl);
}
return this;
}
/**
* @since 2.7
*/
public JsonInclude.Include getNonNillableInclusion() {
return _nonNillableInclusion;
}
/**
* @since 2.12
*/
public JaxbAnnotationModule setNameUsedForXmlValue(String name) {
_nameUsedForXmlValue = name;
return this;
}
public String getNameUsedForXmlValue() {
return _nameUsedForXmlValue;
}
}
⏎ com/fasterxml/jackson/module/jaxb/JaxbAnnotationModule.java
Or download all of them as a single archive file:
File name: jackson-module-jaxb-annotations-2.14.0-sources.jar File size: 27411 bytes Release date: 2022-11-05 Download
⇒ jackson-core-2.2.3.jar - Jackson
2022-05-03, ∼7490🔥, 1💬
Popular Posts:
What is the jaxp\TypeInfoWriter.java provided in the Apache Xerces package? I have Apache Xerces 2.1...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
JDK 11 jdk.jconsole.jmod is the JMOD file for JDK 11 JConsole tool, which can be invoked by the "jco...
How to download and install iText7-Core-7.1.4.zip? iText7-Core-7.1.4.zip is the binary package of iT...