|
Did this page help you?Yes No Tell us about it... |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.services.simpleworkflow.flow.DataConverter
com.amazonaws.services.simpleworkflow.flow.JsonDataConverter
public class JsonDataConverter
Implements conversion through Jackson JSON processor. Consult its
documentation on how to ensure that classes are serializable, configure their
serialization through annotations and ObjectMapper
parameters.
Note that default configuration used by this class includes class name of the every serialized value into the produced JSON. It is done to support polymorphic types out of the box. But in some cases it might be beneficial to disable polymorphic support as it produces much more concise and portable output.
Constructor Summary | |
---|---|
JsonDataConverter()
Create instance of the converter that uses ObjectMapper with Feature#FAIL_ON_UNKNOWN_PROPERTIES set to false and
default typing set to ObjectMapper.DefaultTyping.NON_FINAL . |
|
JsonDataConverter(org.codehaus.jackson.map.ObjectMapper mapper)
Create instance of the converter that uses ObjectMapper
configured externally. |
Method Summary | ||
---|---|---|
|
fromData(String serialized,
Class<T> valueType)
Implements conversion of the single value. |
|
String |
toData(Object value)
Implements conversion of the single value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonDataConverter()
Feature#FAIL_ON_UNKNOWN_PROPERTIES
set to false
and
default typing set to ObjectMapper.DefaultTyping.NON_FINAL
.
public JsonDataConverter(org.codehaus.jackson.map.ObjectMapper mapper)
ObjectMapper
configured externally.
Method Detail |
---|
public String toData(Object value) throws DataConverterException
DataConverter
toData
in class DataConverter
value
- Java value to convert to String.
DataConverterException
- if conversion of the value passed as parameter failed for any
reason.public <T> T fromData(String serialized, Class<T> valueType) throws DataConverterException
DataConverter
fromData
in class DataConverter
DataConverterException
- if conversion of the data passed as parameter failed for any
reason.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |