|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.ip.tcp.serializer.MapJsonSerializer
public class MapJsonSerializer
Serializes a Map
as JSON. Deserializes JSON to
a Map
. The default JacksonJsonObjectMapperProvider.newInstance()
can be
overridden using setJsonObjectMapper(JsonObjectMapper)
.
ByteArrayLfSerializer
, which inserts/expects
LF (0x0a) between messages.
Constructor Summary | |
---|---|
MapJsonSerializer()
|
Method Summary | |
---|---|
java.util.Map<?,?> |
deserialize(java.io.InputStream inputStream)
|
void |
serialize(java.util.Map<?,?> object,
java.io.OutputStream outputStream)
|
void |
setJsonObjectMapper(JsonObjectMapper<?> jsonObjectMapper)
An JsonObjectMapper to be used for the conversion to/from
JSON. |
void |
setPacketDeserializer(org.springframework.core.serializer.Deserializer<byte[]> packetDeserializer)
A Deserializer that will construct the full JSON content from
the stream which is then passed to the JsonObjectMapper. |
void |
setPacketSerializer(org.springframework.core.serializer.Serializer<byte[]> packetSerializer)
A Serializer that will delimit the full JSON content in
the stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapJsonSerializer()
Method Detail |
---|
public void setJsonObjectMapper(JsonObjectMapper<?> jsonObjectMapper)
JsonObjectMapper
to be used for the conversion to/from
JSON. Use this if you wish to set additional JsonObjectMapper
implementation features.
jsonObjectMapper
- the jsonObjectMapper.public void setPacketDeserializer(org.springframework.core.serializer.Deserializer<byte[]> packetDeserializer)
Deserializer
that will construct the full JSON content from
the stream which is then passed to the JsonObjectMapper. Default is
ByteArrayLfSerializer
.
packetDeserializer
- the packetDeserializerpublic void setPacketSerializer(org.springframework.core.serializer.Serializer<byte[]> packetSerializer)
Serializer
that will delimit the full JSON content in
the stream. Default is
ByteArrayLfSerializer
.
packetSerializer
- the packetSerializerpublic java.util.Map<?,?> deserialize(java.io.InputStream inputStream) throws java.io.IOException
deserialize
in interface org.springframework.core.serializer.Deserializer<java.util.Map<?,?>>
java.io.IOException
public void serialize(java.util.Map<?,?> object, java.io.OutputStream outputStream) throws java.io.IOException
serialize
in interface org.springframework.core.serializer.Serializer<java.util.Map<?,?>>
java.io.IOException
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |