public class Json extends FileDataType
DEBUG_SERIALIZATION, fileLock, location, NEWLINE| Constructor and Description |
|---|
Json() |
Json(File location)
Reads and loads a JSON file into memory
|
| Modifier and Type | Method and Description |
|---|---|
Object |
deserializeArray(Object array) |
static String |
format(String json) |
protected Map<String,Object> |
newSection() |
protected Map<String,Object> |
readRaw(File target)
Reads all the information currently saved in the file, disregarding
any changes in memory
|
Object |
serializeArray(Object array) |
Map<String,Object> |
serializeMap(Map<String,Object> toFileFormat) |
String |
toString() |
protected String |
toString(Map<String,Object> section) |
deserializeMap, fromString, get, get, getMutable, getMutable, getRoot, isSet, newInstance, parseDeserializable, parseSerializable, readRaw, save, save, serializationCopy, setpublic Json(File location) throws org.json.simple.parser.ParseException
location - The location of the file to parseorg.json.simple.parser.ParseException - If the file is not in standard JSON formatpublic Json()
protected Map<String,Object> readRaw(File target) throws IOException
FileDataTypereadRaw in class FileDataTypetarget - The File to be readMap<String, Object> value of the target File
This method must return an empty Map<String, Object> if the
file is empty or a reader returns null.IOException - If the file could not be readpublic Map<String,Object> serializeMap(Map<String,Object> toFileFormat)
serializeMap in class FileDataTypepublic Object serializeArray(Object array)
serializeArray in class FileDataTypepublic Object deserializeArray(Object array)
deserializeArray in class FileDataTypeprotected Map<String,Object> newSection()
newSection in class FileDataTypeCopyright © 2017. All rights reserved.