public class JsonConverter
extends java.lang.Object
DataValue
to and from simple JSON representation.
This is the JSON representation which is used in REST rendering of the APIs.
Constructor and Description |
---|
JsonConverter() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
fromDataValue(DataValue value)
This method converts the
DataValue object to a JSON string. |
void |
fromDataValue(DataValue value,
java.io.OutputStream outputStream)
This method converts the
DataValue Object to a ByteArrayOutputStream . |
DataValue |
toDataValue(java.io.InputStream input)
This method converts a JSON passed as an
InputStream into a concrete DataValue object. |
DataValue |
toDataValue(java.lang.String json)
This method converts a JSON string representation into a concrete
DataValue object. |
public DataValue toDataValue(java.lang.String json)
DataValue
object.json
- a String
representation of a JSONDataValue
CoreException
- if the provided InputStream
cannot be deserializedpublic DataValue toDataValue(java.io.InputStream input)
InputStream
into a concrete DataValue
object.input
- the InputStream
we read the JSON from, which will be closed before the method returns
or throws a CoreException
DataValue
CoreException
- if the provided InputStream
cannot be deserializedpublic java.lang.String fromDataValue(DataValue value)
DataValue
object to a JSON string.value
- a DataValue
object we want to convert to JSONDataValue
CoreException
- if the provided DataValue
cannot be serializedpublic void fromDataValue(DataValue value, java.io.OutputStream outputStream)
DataValue
Object to a ByteArrayOutputStream
.value
- a DataValue
outputStream
- stream to write the serialized result to, which will be closed before the method returns
or throws a CoreException
CoreException
- if the provided DataValue
cannot be serialized