Package com.cumulocity.model
Class JSONBase
java.lang.Object
org.svenson.AbstractDynamicProperties
com.cumulocity.model.JSONBase
- All Implemented Interfaces:
Serializable
,org.svenson.DynamicProperties
- Direct Known Subclasses:
Document
public class JSONBase
extends org.svenson.AbstractDynamicProperties
Base class for all the core classes represented in JSON.
- Author:
- Sameer Babu KK
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Unmarshall the JSON representation to an object of the specified type.static <T> T
Unmarshall the JSON representation to an object of the specified type.static org.svenson.JSON
static org.svenson.JSON
static org.svenson.JSONParser
toJSON()
Marshall the object representation to JSON using svenson library.Methods inherited from class org.svenson.AbstractDynamicProperties
getAttrs, getProperty, hasProperty, propertyNames, removeProperty, setProperty
-
Field Details
-
ID_TYPE_CONVERTER_NAME
- See Also:
-
-
Constructor Details
-
JSONBase
public JSONBase()
-
-
Method Details
-
toJSON
Marshall the object representation to JSON using svenson library. There different type converters defined and conversion uses the type converter repository.- Returns:
- the JSON representation.
-
fromJSON
Unmarshall the JSON representation to an object of the specified type. There different type converters defined and conversion uses the type converter repository.- Parameters:
type
- The class typejson
- the json string- Returns:
- the object of the given type
-
fromJSON
Unmarshall the JSON representation to an object of the specified type. There different type converters defined and conversion uses the type converter repository.- Parameters:
type
- The class typejson
- the json reader- Returns:
- the object of the given type
-
getJSONGenerator
@JSONProperty(ignore=true) public static org.svenson.JSON getJSONGenerator() -
getJSONGeneratorWithUTF8Encoding
@JSONProperty(ignore=true) public static org.svenson.JSON getJSONGeneratorWithUTF8Encoding() -
getJSONParser
@JSONProperty(ignore=true) public static org.svenson.JSONParser getJSONParser()
-