public abstract class AbstractConfigurationLoader<NodeType extends ConfigurationNode> extends Object implements ConfigurationLoader<NodeType>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractConfigurationLoader.Builder<T extends AbstractConfigurationLoader.Builder> |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIGURATE_LINE_SEPARATOR |
protected static Splitter |
LINE_SPLITTER |
protected Callable<BufferedReader> |
source |
protected static String |
SYSTEM_LINE_SEPARATOR |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConfigurationLoader(AbstractConfigurationLoader.Builder<?> builder,
CommentHandler[] commentHandlers) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLoad() |
boolean |
canSave() |
CommentHandler |
getDefaultCommentHandler() |
ConfigurationOptions |
getDefaultOptions()
Get the default options that any new nodes will be created with if no options object is passed.
|
NodeType |
load(ConfigurationOptions options)
Create a new configuration node populated with the appropriate data, structured with the provided options.
|
protected abstract void |
loadInternal(NodeType node,
BufferedReader reader) |
void |
save(ConfigurationNode node)
Save the contents of the given node tree to this loader.
|
protected abstract void |
saveInternal(ConfigurationNode node,
Writer writer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateEmptyNode, createEmptyNode, loadpublic static final String CONFIGURATE_LINE_SEPARATOR
protected static final Splitter LINE_SPLITTER
protected static final String SYSTEM_LINE_SEPARATOR
protected final Callable<BufferedReader> source
protected AbstractConfigurationLoader(AbstractConfigurationLoader.Builder<?> builder, CommentHandler[] commentHandlers)
public CommentHandler getDefaultCommentHandler()
public NodeType load(ConfigurationOptions options) throws IOException
ConfigurationLoaderload in interface ConfigurationLoader<NodeType extends ConfigurationNode>options - The options to load withIOException - if any sort of error occurs with reading or parsing the configurationprotected abstract void loadInternal(NodeType node, BufferedReader reader) throws IOException
IOExceptionpublic void save(ConfigurationNode node) throws IOException
ConfigurationLoadersave in interface ConfigurationLoader<NodeType extends ConfigurationNode>node - The node a save is being requested forIOException - if any sort of error occurs with writing or generating the configurationprotected abstract void saveInternal(ConfigurationNode node, Writer writer) throws IOException
IOExceptionpublic ConfigurationOptions getDefaultOptions()
getDefaultOptions in interface ConfigurationLoader<NodeType extends ConfigurationNode>public boolean canLoad()
public boolean canSave()
Copyright © 2014–2017. All rights reserved.