public final class KomodoJsonMarshaller extends Object
Komodo REST objects
.Modifier and Type | Field and Description |
---|---|
static com.google.gson.Gson |
BUILDER
The shared JSON serialier/deserializer for
RestBasicEntity objects. |
static com.google.gson.Gson |
PRETTY_BUILDER |
Modifier and Type | Method and Description |
---|---|
static String |
marshall(KRestEntity entity)
Outputs a non-pretty printed JSON representation.
|
static String |
marshall(KRestEntity entity,
boolean prettyPrint) |
static String |
marshallArray(KRestEntity[] entities,
boolean prettyPrint) |
static String |
teiidElementSchema(org.komodo.spi.repository.KomodoType kType) |
static <T extends KRestEntity> |
unmarshall(String json,
Class<T> entityClass) |
static <T extends KRestEntity> |
unmarshallArray(String json,
Class<T[]> entityClass) |
public static final com.google.gson.Gson BUILDER
RestBasicEntity
objects.public static final com.google.gson.Gson PRETTY_BUILDER
public static String teiidElementSchema(org.komodo.spi.repository.KomodoType kType) throws Exception
Exception
public static String marshall(KRestEntity entity)
entity
- the entity whose JSON representation is being requested (cannot be null
)public static String marshall(KRestEntity entity, boolean prettyPrint)
entity
- the entity whose JSON representation is being requested (cannot be null
)prettyPrint
- true
if JSON output should be pretty printedpublic static String marshallArray(KRestEntity[] entities, boolean prettyPrint)
entities
- the entities whose JSON representation is being requested (cannot be null
)prettyPrint
- true
if JSON output should be pretty printedpublic static <T extends KRestEntity> T unmarshall(String json, Class<T> entityClass)
T
- the RestBasicEntity
type of the outputjson
- the JSON representation being converted to a RestBasicEntity
(cannot be empty)entityClass
- the type of RestBasicEntity
the JSON will be converted to (cannot be null
)RestBasicEntity
(never null
)public static <T extends KRestEntity> T[] unmarshallArray(String json, Class<T[]> entityClass)
T
- the RestBasicEntity
type of the outputjson
- the JSON representation being converted to a RestBasicEntity
(cannot be empty)entityClass
- the type of RestBasicEntity
the JSON will be converted to (cannot be null
)RestBasicEntity
(never null
)Copyright © 2013–2019. All rights reserved.