public interface LoadableConfiguration
Modifier and Type | Method and Description |
---|---|
void |
load(Reader reader)
Loads this configuration from the specified reader.
|
void |
loadFromString(String contents)
Loads this configuration from the specified string.
|
void |
save(Writer writer)
Saves this configuration to a writer.
|
String |
saveToString()
Saves this configuration to a string, and returns it.
|
void loadFromString(String contents) throws IOException, InvalidConfigurationException
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.
contents
- Contents of a Configuration to load.IOException
- if cannot read contents.InvalidConfigurationException
- if the specified string is invalid.IllegalArgumentException
- if contents is null.String saveToString() throws IOException
IOException
- when the contents cannot be written for any reason.void load(Reader reader) throws IOException, InvalidConfigurationException
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.
reader
- Reader of a Configuration to load.IOException
- if reader throws an IOException.InvalidConfigurationException
- if the specified configuration is invalid.IllegalArgumentException
- if reader is null.void save(Writer writer) throws IOException
writer
- where to save this configurationIOException
- when the contents cannot be written for any reason.Copyright © 2023. All rights reserved.