Modifier and Type | Method and Description |
---|---|
Object |
get(String path)
Gets the object at the specified path
|
Object |
get(String path,
Object def)
Gets the object at the specified path, or returns the passed "default"
value if nothing is found
|
boolean |
isSet(String path)
Returns whether or not there is an object located at the specified path
|
static <T extends FileDataType> |
newInstance(Class<T> clazz,
File location)
Returns a new instance of a
FileDataType based on the passed
class instance. |
void |
save()
Saves any information in memory to the file it was loaded from.
|
void |
save(File target)
Saves any information in memory to the file specified.
|
void |
set(String path,
Object value)
Sets the value at the location specified by the passed path
|
void set(String path, Object value)
path
- The path to set, delimited by '.
'value
- The value to setboolean isSet(String path)
path
- The path to set, delimited by '.
'true
if a value is found, false
otherwiseObject get(String path)
path
- The path to set, delimited by '.
'null
if
nothing is foundObject get(String path, Object def)
path
- The path to set, delimited by '.
'def
- The default value to return upon not finding a valuevoid save() throws IOException
IOException
- Any read/write locks or permission errors on the filevoid save(File target) throws IOException
target
- The file to save toIOException
- Any read/write locks or permission errors on the filestatic <T extends FileDataType> T newInstance(Class<T> clazz, File location)
FileDataType
based on the passed
class instance.T
- Represents the type that implements FileDataType
clazz
- The class object to be used for a new instancelocation
- The location of the file to parse and useFileDataType
Copyright © 2015. All rights reserved.