diff --git a/build.gradle b/build.gradle
index de08f29005..5350a7dce1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -48,6 +48,7 @@ configure(allprojects) { project ->
ext.tomcatVersion = "8.0.9"
ext.xstreamVersion = "1.4.7"
ext.protobufVersion = "2.5.0"
+ ext.woodstoxVersion = "4.1.6"
ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
@@ -326,7 +327,7 @@ project("spring-core") {
optional("log4j:log4j:1.2.17")
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
testCompile("xmlunit:xmlunit:1.5")
- testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") {
+ testCompile("org.codehaus.woodstox:woodstox-core-asl:${woodstoxVersion}") {
exclude group: "stax", module: "stax-api"
}
}
@@ -665,6 +666,7 @@ project("spring-web") {
optional("org.apache.httpcomponents:httpclient:4.3.4")
optional("org.apache.httpcomponents:httpasyncclient:4.0.1")
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
+ optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
optional("com.google.code.gson:gson:${gsonVersion}")
optional("com.rometools:rome:1.5.0")
optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
@@ -824,6 +826,7 @@ project("spring-webmvc") {
exclude group: "xml-apis", module: "xml-apis"
}
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
+ optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
optional("com.rometools:rome:1.5.0")
optional("javax.el:javax.el-api:2.2.5")
optional("org.apache.tiles:tiles-api:${tiles3Version}")
diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java
new file mode 100644
index 0000000000..56d3760c96
--- /dev/null
+++ b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java
@@ -0,0 +1,315 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.http.converter.json;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.charset.Charset;
+import java.util.concurrent.atomic.AtomicReference;
+
+import com.fasterxml.jackson.core.JsonEncoding;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+import org.springframework.http.HttpInputMessage;
+import org.springframework.http.HttpOutputMessage;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.AbstractHttpMessageConverter;
+import org.springframework.http.converter.GenericHttpMessageConverter;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.http.converter.HttpMessageNotWritableException;
+import org.springframework.util.Assert;
+import org.springframework.util.ClassUtils;
+
+/**
+ * Abstract base class for Jackson based and content type independent
+ * {@link HttpMessageConverter} implementations.
+ *
+ *
Compatible with Jackson 2.1 and higher.
+ *
+ * @author Arjen Poutsma
+ * @author Keith Donald
+ * @author Rossen Stoyanchev
+ * @author Juergen Hoeller
+ * @author Sebastien Deleuze
+ * @since 4.1
+ */
+public abstract class AbstractJackson2HttpMessageConverter extends
+ AbstractHttpMessageConverter