public class JsonConverter extends 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 |
|---|---|
String |
fromDataValue(DataValue value)
This method converts the
DataValue object to a JSON string. |
void |
fromDataValue(DataValue value,
OutputStream outputStream)
This method converts the
DataValue Object to a ByteArrayOutputStream. |
DataValue |
toDataValue(InputStream input)
This method converts a JSON passed as an
InputStream into a concrete DataValue object. |
DataValue |
toDataValue(String json)
This method converts a JSON string representation into a concrete
DataValue object. |
public DataValue toDataValue(String json)
DataValue object.json - a String representation of a JSONDataValueCoreException - if the provided InputStream cannot be deserializedpublic DataValue toDataValue(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 CoreExceptionDataValueCoreException - if the provided InputStream cannot be deserializedpublic String fromDataValue(DataValue value)
DataValue object to a JSON string.value - a DataValue object we want to convert to JSONDataValueCoreException - if the provided DataValue cannot be serializedpublic void fromDataValue(DataValue value, OutputStream outputStream)
DataValue Object to a ByteArrayOutputStream.value - a DataValueoutputStream - stream to write the serialized result to, which will be closed before the method returns
or throws a CoreExceptionCoreException - if the provided DataValue cannot be serializedCopyright © 2023. All rights reserved.