|
|
|
@ -41,7 +41,7 @@ import org.springframework.util.Assert;
@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.ClassUtils; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for client or server codec configurers. |
|
|
|
|
* Base class for client or server HTTP message reader and writer configurers. |
|
|
|
|
* |
|
|
|
|
* @author Rossen Stoyanchev |
|
|
|
|
* @since 5.0 |
|
|
|
@ -103,13 +103,13 @@ public abstract class AbstractCodecConfigurer {
@@ -103,13 +103,13 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
List<HttpMessageReader<?>> result = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
addDefaultTypedReaders(result); |
|
|
|
|
addCustomTypedReaders(result); |
|
|
|
|
customCodec().addTypedReadersTo(result); |
|
|
|
|
|
|
|
|
|
addDefaultObjectReaders(result); |
|
|
|
|
addCustomObjectReaders(result); |
|
|
|
|
customCodec().addObjectReadersTo(result); |
|
|
|
|
|
|
|
|
|
// String + "*/*"
|
|
|
|
|
defaultCodec().addStringReaderTo(result); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -124,13 +124,6 @@ public abstract class AbstractCodecConfigurer {
@@ -124,13 +124,6 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
defaultCodec().addStringReaderTextOnlyTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add custom, concrete, Java type readers. |
|
|
|
|
*/ |
|
|
|
|
protected void addCustomTypedReaders(List<HttpMessageReader<?>> result) { |
|
|
|
|
customCodec().addTypedReadersTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add built-in, Object-based readers. |
|
|
|
|
*/ |
|
|
|
@ -143,14 +136,6 @@ public abstract class AbstractCodecConfigurer {
@@ -143,14 +136,6 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add custom, Object-based readers. |
|
|
|
|
*/ |
|
|
|
|
protected void addCustomObjectReaders(List<HttpMessageReader<?>> result) { |
|
|
|
|
customCodec().addObjectReadersTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Prepare a list of HTTP message writers. |
|
|
|
|
*/ |
|
|
|
@ -159,14 +144,13 @@ public abstract class AbstractCodecConfigurer {
@@ -159,14 +144,13 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
List<HttpMessageWriter<?>> result = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
addDefaultTypedWriter(result); |
|
|
|
|
addCustomTypedWriter(result); |
|
|
|
|
customCodec().addTypedWritersTo(result); |
|
|
|
|
|
|
|
|
|
addDefaultObjectWriters(result); |
|
|
|
|
addCustomObjectWriters(result); |
|
|
|
|
customCodec().addObjectWritersTo(result); |
|
|
|
|
|
|
|
|
|
// String + "*/*"
|
|
|
|
|
defaultCodec().addStringWriterTo(result); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -181,13 +165,6 @@ public abstract class AbstractCodecConfigurer {
@@ -181,13 +165,6 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
defaultCodec().addStringWriterTextPlainOnlyTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add custom, concrete, Java type readers. |
|
|
|
|
*/ |
|
|
|
|
protected void addCustomTypedWriter(List<HttpMessageWriter<?>> result) { |
|
|
|
|
customCodec().addTypedWritersTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add built-in, Object-based readers. |
|
|
|
|
*/ |
|
|
|
@ -200,14 +177,6 @@ public abstract class AbstractCodecConfigurer {
@@ -200,14 +177,6 @@ public abstract class AbstractCodecConfigurer {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Add custom, Object-based readers. |
|
|
|
|
*/ |
|
|
|
|
protected void addCustomObjectWriters(List<HttpMessageWriter<?>> result) { |
|
|
|
|
customCodec().addObjectWritersTo(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* A registry and a factory for built-in HTTP message readers and writers. |
|
|
|
|