Class JsonUdtValue
- java.lang.Object
- 
- de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValue
- 
- de.aristaflow.adept2.model.datamanagement.JsonUdtValue
 
 
- 
- All Implemented Interfaces:
- UDTValue,- TypedCloneable<ADEPT2UDTValue>,- Closeable,- Serializable,- AutoCloseable,- Cloneable
 
 public class JsonUdtValue extends ADEPT2UDTValue A User Defined Type for JSON data.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringUDT_NAMETheADEPT2UDTValue.getUserDefinedType()of the user defined type.- 
Fields inherited from class de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValuecleanup, data, userDefinedTypeName
 
- 
 - 
Constructor SummaryConstructors Constructor Description JsonUdtValue(byte[] value)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])instead.JsonUdtValue(InputStream stream)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])instead.JsonUdtValue(InputStream stream, boolean eager)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream)instead.JsonUdtValue(InputStream stream, boolean... dummy)Creates a newUDTValuefor the designated input stream containing a UTF-8 encoded string representing aJSONObject.JsonUdtValue(InputStream stream, int length)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])with aBoundedInputStreaminstead.JsonUdtValue(String jsonString)Creates a newUDTValuefor the designated string.JsonUdtValue(org.json.JSONObject json)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(JSONObject, boolean[])instead.JsonUdtValue(org.json.JSONObject json, boolean... dummy)Creates a newUDTValuefor the designatedJSONObject.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.json.JSONObjectfromByteArray(byte[] bytes)Returns the JSON object from the given byte array or null if there is no data.static org.json.JSONObjectfromUdtValue(UDTValue udt)Gets theJSONObjectfrom the designated UDT ornullif there is no data.static org.json.JSONObjectfromUDTValue(UDTValue udt)Deprecated, for removal: This API element is subject to removal in a future version.UsefromUdtValue(UDTValue)instead.org.json.JSONObjectgetJsonObject()Gets the current value asJSONObjectornullif there is no data.static StringgetJsonString(UDTValue udtValue)Gets the string content of the designatedUDTValue.org.json.JSONObjectgetValueAsJsonObject()Deprecated, for removal: This API element is subject to removal in a future version.UsegetJsonObject()instead.static StringrawTextFromUDTValue(UDTValue udtValue)Deprecated, for removal: This API element is subject to removal in a future version.UsegetJsonString(UDTValue)instead.static byte[]toUtf8Bytes(org.json.JSONObject json)Deprecated, for removal: This API element is subject to removal in a future version.UsetoUtf8InputStream(JSONObject)instead.static InputStreamtoUtf8InputStream(org.json.JSONObject json)Gets an input stream containing the UTF-8 string representing the designatedJSONObject.static UDTValueudtValueFromRawText(String jsonText)Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(String)instead.- 
Methods inherited from class de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValueclone, clone, cloneUnchecked, close, equals, getBytes, getInputStream, getSize, getUserDefinedType, getValueAsArray, getValueAsStream, hashCode, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface de.aristaflow.adept2.model.datamanagement.UDTValuegetContentString, getSize, isEmpty
 
- 
 
- 
- 
- 
Field Detail- 
UDT_NAMEpublic static final String UDT_NAME TheADEPT2UDTValue.getUserDefinedType()of the user defined type.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
JsonUdtValue@Deprecated(since="15.0.0", forRemoval=true) public JsonUdtValue(org.json.JSONObject json) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(JSONObject, boolean[])instead.
 - 
JsonUdtValuepublic JsonUdtValue(org.json.JSONObject json, boolean... dummy) throws IOExceptionCreates a newUDTValuefor the designatedJSONObject.- Parameters:
- json- The- JSONObjectfor which to create a- UDTValue.
- dummy- Ignored, just distinguishes from the deprecated constructor.
- Throws:
- IOException- If there are problems creating the input stream or reading from it, an- IOExceptionwill be thrown.
 
 - 
JsonUdtValue@Deprecated(since="15.0.0", forRemoval=true) public JsonUdtValue(byte[] value) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])instead.
 - 
JsonUdtValuepublic JsonUdtValue(String jsonString) throws IOException Creates a newUDTValuefor the designated string. This should represent a validJSONObject.- Parameters:
- jsonString- The string representing a- JSONObjectfor which to create a- UDTValue.
- Throws:
- IOException- If there are problems creating the input stream or reading from it, an- IOExceptionwill be thrown.
 
 - 
JsonUdtValue@Deprecated(since="15.0.0", forRemoval=true) public JsonUdtValue(InputStream stream, boolean eager) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream)instead.
 - 
JsonUdtValue@Deprecated(since="15.0.0", forRemoval=true) public JsonUdtValue(InputStream stream, int length) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])with aBoundedInputStreaminstead.
 - 
JsonUdtValue@Deprecated(since="15.0.0", forRemoval=true) public JsonUdtValue(InputStream stream) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(InputStream, boolean[])instead.
 - 
JsonUdtValuepublic JsonUdtValue(InputStream stream, boolean... dummy) throws IOException Creates a newUDTValuefor the designated input stream containing a UTF-8 encoded string representing aJSONObject.- Parameters:
- stream- The input stream containing the UTF-8 encoded string representation of a- JSONObjectfor which to create a- UDTValue. The stream will be closed after the creation.
- dummy- Ignored, just distinguishes from the deprecated constructor.
- Throws:
- IOException- If there are problems creating the data structures for the content, an- IOExceptionwill be thrown.
 
 
- 
 - 
Method Detail- 
toUtf8Bytes@Deprecated(since="15.0.0", forRemoval=true) public static byte[] toUtf8Bytes(org.json.JSONObject json) Deprecated, for removal: This API element is subject to removal in a future version.UsetoUtf8InputStream(JSONObject)instead.Converts the given JSONObject to a UTF-8 encoded byte array.- Parameters:
- json- The JSON object to be converted.
- Returns:
- The byte array.
 
 - 
toUtf8InputStreampublic static InputStream toUtf8InputStream(org.json.JSONObject json) throws IOException Gets an input stream containing the UTF-8 string representing the designatedJSONObject.- Parameters:
- json- The- JSONObjectfor which to get an input stream.
- Returns:
- An input stream containing the UTF-8 string representing the designated
         JSONObject.
- Throws:
- IOException- If there are problems creating the input stream, an- IOExceptionwill be thrown.
 
 - 
getValueAsJsonObject@Deprecated(since="15.0.0", forRemoval=true) public org.json.JSONObject getValueAsJsonObject() Deprecated, for removal: This API element is subject to removal in a future version.UsegetJsonObject()instead.Returns the current value as JSON object or null if there is no data.- Returns:
- The UDT value as JSON object or null if there is no data.
 
 - 
getJsonObjectpublic org.json.JSONObject getJsonObject() throws IOExceptionGets the current value asJSONObjectornullif there is no data.- Returns:
- The UDT value as JSONObjectornullif there is no data.
- Throws:
- IOException- If there are problems reading the content of the designated- UDTValue, an- IOExceptionwill be thrown.
- See Also:
- fromUdtValue(UDTValue)
 
 - 
fromUDTValue@Deprecated(since="15.0.0", forRemoval=true) public static org.json.JSONObject fromUDTValue(UDTValue udt) Deprecated, for removal: This API element is subject to removal in a future version.UsefromUdtValue(UDTValue)instead.Returns the JSON object from the given UDT or null if there is no data.- Returns:
- The JSON object or null if there is no data.
 
 - 
fromUdtValuepublic static org.json.JSONObject fromUdtValue(UDTValue udt) throws IOException Gets theJSONObjectfrom the designated UDT ornullif there is no data. The designatedUDTValuehas to contain a valid JSON object (as UTF-8 encoded string).- Parameters:
- udt- The- UDTValuecontaining a UTF-8 encoded string representing a- JSONObject. The caller is responsible for closing.
- Returns:
- The JSONObjectornullif there is no data.
- Throws:
- IOException- If there are problems reading the content of the designated- UDTValue, an- IOExceptionwill be thrown.
- IllegalArgumentException- If the designated- UDTValuehas the wrong type, an- IllegalArgumentExceptionwill be thrown.
 
 - 
fromByteArraypublic static org.json.JSONObject fromByteArray(byte[] bytes) Returns the JSON object from the given byte array or null if there is no data.- Returns:
- The JSON object or null if there is no data.
 
 - 
rawTextFromUDTValue@Deprecated(since="15.0.0", forRemoval=true) public static String rawTextFromUDTValue(UDTValue udtValue) Deprecated, for removal: This API element is subject to removal in a future version.UsegetJsonString(UDTValue)instead.Reads the JSON from theUDTValueas a raw string.- Parameters:
- udtValue- the JSON UDT value
- Returns:
- the JSON as a raw string
 
 - 
getJsonStringpublic static String getJsonString(UDTValue udtValue) throws IOException Gets the string content of the designatedUDTValue.- Parameters:
- udtValue- The- UDTValuefrom which to get the content as string. The caller is responsible for closing.
- Returns:
- The string content of the designated UDTValue.
- Throws:
- IOException- If there are problems reading the content of the designated- UDTValue, an- IOExceptionwill be thrown.
- IllegalArgumentException- If the designated- UDTValuehas the wrong type, an- IllegalArgumentExceptionwill be thrown.
 
 - 
udtValueFromRawText@Deprecated(since="15.0.0", forRemoval=true) public static UDTValue udtValueFromRawText(String jsonText) Deprecated, for removal: This API element is subject to removal in a future version.UseJsonUdtValue(String)instead.Returns anUDTValuefrom the raw JSON string.- Parameters:
- jsonText- the raw JSON text
- Returns:
- an UDTValuecontaining the JSON
 
 
- 
 
-