public class Yaml extends Object implements FileDataType
| Modifier and Type | Field and Description |
|---|---|
protected File |
location
The location of this
FileDataType |
protected org.bukkit.configuration.file.FileConfiguration |
yaml
The underlying
FileConfiguration object |
| Constructor and Description |
|---|
Yaml(File location)
Reads and loads a YAML file into memory.
|
| 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
|
org.bukkit.configuration.file.FileConfiguration |
getFileConfiguration()
Returns the underlying
FileConfiguration used in reading the YAML
file. |
boolean |
isSet(String path)
Returns whether or not there is an object located at the specified path
|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewInstanceprotected final File location
FileDataTypeprotected final org.bukkit.configuration.file.FileConfiguration yaml
FileConfiguration objectpublic Yaml(File location)
location - The location of the file to readpublic boolean isSet(String path)
isSet in interface FileDataTypepath - The path to set, delimited by '.'true if a value is found, false otherwisepublic void set(String path, Object value)
set in interface FileDataTypepath - The path to set, delimited by '.'value - The value to setpublic Object get(String path)
get in interface FileDataTypepath - The path to set, delimited by '.'null if
nothing is foundpublic Object get(String path, Object def)
get in interface FileDataTypepath - The path to set, delimited by '.'def - The default value to return upon not finding a valuepublic void save()
throws IOException
save in interface FileDataTypeIOException - Any read/write locks or permission errors on the filepublic void save(File target) throws IOException
save in interface FileDataTypetarget - The file to save toIOException - Any read/write locks or permission errors on the filepublic org.bukkit.configuration.file.FileConfiguration getFileConfiguration()
FileConfiguration used in reading the YAML
file.FileConfiguration in useCopyright © 2015. All rights reserved.