org.axonframework.serializer.json
Class ByteArrayToJsonNodeConverter

java.lang.Object
  extended by org.axonframework.serializer.AbstractContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>
      extended by org.axonframework.serializer.json.ByteArrayToJsonNodeConverter
All Implemented Interfaces:
ContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>

public class ByteArrayToJsonNodeConverter
extends AbstractContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>

ContentTypeConverter implementation that converts byte[] containing UTF8 encoded JSON string to a Jackson JsonNode.

Since:
2.2
Author:
Allard Buijze

Constructor Summary
ByteArrayToJsonNodeConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
          Initialize the Converter, using given objectMapper to parse the binary contents
 
Method Summary
 com.fasterxml.jackson.databind.JsonNode convert(byte[] original)
          Converts the given object into another.
 Class<byte[]> expectedSourceType()
          The expected type of input data.
 Class<com.fasterxml.jackson.databind.JsonNode> targetType()
          The returned type of IntermediateRepresentation
 
Methods inherited from class org.axonframework.serializer.AbstractContentTypeConverter
convert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayToJsonNodeConverter

public ByteArrayToJsonNodeConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Initialize the Converter, using given objectMapper to parse the binary contents

Parameters:
objectMapper - the Jackson ObjectMapper to parse the byte array with
Method Detail

expectedSourceType

public Class<byte[]> expectedSourceType()
Description copied from interface: ContentTypeConverter
The expected type of input data.

Returns:
the expected data format in IntermediateRepresentation

targetType

public Class<com.fasterxml.jackson.databind.JsonNode> targetType()
Description copied from interface: ContentTypeConverter
The returned type of IntermediateRepresentation

Returns:
the output data format in IntermediateRepresentation

convert

public com.fasterxml.jackson.databind.JsonNode convert(byte[] original)
Description copied from interface: ContentTypeConverter
Converts the given object into another. Typically, these values are contained by a SerializedObject instance.

Parameters:
original - the value to convert
Returns:
the converted value


Copyright © 2010-2016. All Rights Reserved.