public final class ExtendedQALDJSONLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
private |
ExtendedQALDJSONLoader()
Make this class non instatiable.
|
| Modifier and Type | Method and Description |
|---|---|
static Object |
readJson(byte[] inputJson,
Class<?> type)
Parses Json file and returns an Object containing the results.
|
static Object |
readJson(File f) |
static Object |
readJson(File f,
Class<?> type) |
static Object |
readJson(InputStream in) |
static Object |
readJson(InputStream in,
Class<?> type)
Parses Json file and returns an Object containing the results.
|
static byte[] |
writeJson(Object json)
Writes the json to an byte array
|
static void |
writeJson(Object o,
File f,
boolean overwrite)
Loads and saves Settings into and from json files /** Writes the given Object as JSON to location specified in File.
|
private ExtendedQALDJSONLoader()
public static void writeJson(Object o, File f, boolean overwrite) throws IOException
o - The object you want to write.f - The File (-location) to save it in.overwrite - Set this true to overwrite existing file.IOExceptionpublic static byte[] writeJson(Object json) throws com.fasterxml.jackson.core.JsonProcessingException
json - com.fasterxml.jackson.core.JsonProcessingExceptionpublic static Object readJson(byte[] inputJson, Class<?> type) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
inputJson - the json to parsetype - The class type you want to read.IOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonParseExceptionpublic static Object readJson(InputStream in, Class<?> type) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
f - The file location you want to read from.type - The class type you want to read.IOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonParseExceptionpublic static Object readJson(InputStream in) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static Object readJson(File f) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic static Object readJson(File f, Class<?> type) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, FileNotFoundException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionFileNotFoundExceptionIOExceptionCopyright © 2016–2020. All rights reserved.