Package org.simpleyaml.configuration
Interface LoadableConfiguration
- All Known Implementing Classes:
FileConfiguration
public interface LoadableConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionvoidLoads this configuration from the specified reader.voidloadFromString(String contents) Loads this configuration from the specified string.voidSaves this configuration to a writer.Saves this configuration to a string, and returns it.
-
Method Details
-
loadFromString
Loads this configuration from the specified string.All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.
If the string is invalid in any way, an exception will be thrown.
- Parameters:
contents- Contents of a Configuration to load.- Throws:
IOException- if cannot read contents.InvalidConfigurationException- if the specified string is invalid.IllegalArgumentException- if contents is null.
-
saveToString
Saves this configuration to a string, and returns it.- Returns:
- a String containing this configuration.
- Throws:
IOException- when the contents cannot be written for any reason.
-
load
Loads this configuration from the specified reader.All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.
If the contents are invalid in any way, an exception will be thrown.
- Parameters:
reader- Reader of a Configuration to load.- Throws:
IOException- if reader throws an IOException.InvalidConfigurationException- if the specified configuration is invalid.IllegalArgumentException- if reader is null.
-
save
Saves this configuration to a writer.- Parameters:
writer- where to save this configuration- Throws:
IOException- when the contents cannot be written for any reason.
-