All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.jackson.dataformat.xml.jaxb.XmlJaxbAnnotationIntrospector Maven / Gradle / Ivy

Go to download

Data format extension for Jackson (http://jackson.codehaus.org) to offer alternative support for serializing POJOs as XML and deserializing XML as pojos. Support implemented on top of Stax API (javax.xml.stream), by implementing core Jackson Streaming API types like JsonGenerator, JsonParser and JsonFactory. Some data-binding types overridden as well (ObjectMapper sub-classed as XmlMapper).

There is a newer version: 2.17.1
Show newest version
package com.fasterxml.jackson.dataformat.xml.jaxb;

import com.fasterxml.jackson.databind.introspect.*;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.dataformat.xml.XmlAnnotationIntrospector;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;

/**
 * Alternative {@link com.fasterxml.jackson.databind.AnnotationIntrospector}
 * implementation that
 * builds on {@link JaxbAnnotationIntrospector}.
 *

* NOTE: since version 2.4, it may NOT be necessary to use this class; * instead, plain {@link JaxbAnnotationIntrospector} should fully work. * With previous versions some aspects were not fully working and this * class was necessary. */ public class XmlJaxbAnnotationIntrospector extends JaxbAnnotationIntrospector implements XmlAnnotationIntrospector { private static final long serialVersionUID = 1L; // since 2.7 @Deprecated public XmlJaxbAnnotationIntrospector() { super(); } public XmlJaxbAnnotationIntrospector(TypeFactory typeFactory) { super(typeFactory); } /* /********************************************************************** /* XmlAnnotationIntrospector overrides /********************************************************************** */ @Override public String findNamespace(Annotated ann) { return super.findNamespace(ann); } @Override public Boolean isOutputAsAttribute(Annotated ann) { return super.isOutputAsAttribute(ann); } @Override public Boolean isOutputAsText(Annotated ann) { return super.isOutputAsText(ann); } @Override public Boolean isOutputAsCData(Annotated ann) { //There is no CData annotation in JAXB return null; } @Override public void setDefaultUseWrapper(boolean b) { // nothing to do with JAXB } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy