public class JSONHelper extends Object
Modifier and Type | Class and Description |
---|---|
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 |
getSimpleGSON()
Retrieves a simple GSON object for standard creation of JSON
|
static <T extends BroadWorksObjectInformation> |
inputBroadWorksInformation(Type type,
FileReader fileReader)
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 getSimpleGSON()
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) throws HelperException
T
- The Information typetype
- The Information typefileReader
- The file reader for the JSON objectHelperException
Copyright © 2016. All rights reserved.