public class JSONHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JSONHelper.BroadWorksServerPostProcessor |
static class |
JSONHelper.OptionalTypeAdapter
A handler for serialization and deserialization of Optionals.
|
Constructor and Description |
---|
JSONHelper() |
Modifier and Type | Method and Description |
---|---|
static com.google.gson.Gson |
getDeserializerGSON(co.ecg.alpaca.toolkit.model.BroadWorksServer broadWorksServer)
Retrieves a deserializer GSON object for standard deserialization of JSON to Alpaca Objects
|
static com.google.gson.Gson |
getSerializerGSON()
Retrieves a serializer GSON object for standard creation of JSON from Alpaca Objects
|
static <T extends BroadWorksObjectInformation> |
inputBroadWorksInformation(Type type,
FileReader fileReader,
co.ecg.alpaca.toolkit.model.BroadWorksServer broadWorksServer)
Imports a BroadWorksObjectInformation class from the specified File
|
static <T extends BroadWorksObjectInformation> |
outputBroadWorksInformation(T information,
FileWriter fileWriter)
Outputs a BroadWorksObjectInformation class as JSON to the specified
FileOutputStream
|
public static com.google.gson.Gson getSerializerGSON()
public static com.google.gson.Gson getDeserializerGSON(co.ecg.alpaca.toolkit.model.BroadWorksServer broadWorksServer) throws HelperException
broadWorksServer
- The BroadWorksServer to deserialize into.HelperException
public static <T extends BroadWorksObjectInformation> void outputBroadWorksInformation(T information, FileWriter fileWriter) throws HelperException
T
- The Information typeinformation
- The input informationfileWriter
- The output stream for the generated JSONHelperException
public static <T extends BroadWorksObjectInformation> T inputBroadWorksInformation(Type type, FileReader fileReader, co.ecg.alpaca.toolkit.model.BroadWorksServer broadWorksServer) throws HelperException
T
- The Information typetype
- The Information typefileReader
- The file reader for the JSON objectbroadWorksServer
- The BroadWorksServer to deserialize into.HelperException
Copyright © 2016. All rights reserved.