Added new FileConfigurationOptions.copyHeader, defaulting to true. Copies the header from default config, if there is one.

This commit is contained in:
Nathan Adams
2011-10-12 13:24:57 +01:00
parent ab46572125
commit 98633dfddf
6 changed files with 153 additions and 54 deletions

View File

@@ -178,6 +178,16 @@ public abstract class FileConfiguration extends MemoryConfiguration {
* @throws IllegalArgumentException Thrown if contents is null.
*/
public abstract void loadFromString(String contents) throws InvalidConfigurationException;
/**
* Compiles the header for this {@link FileConfiguration} and returns the result.
* <p>
* This will use the header from {@link #options()} -> {@link FileConfigurationOptions#header()},
* respecting the rules of {@link FileConfigurationOptions#copyHeader()} if set.
*
* @return Compiled header
*/
protected abstract String buildHeader();
@Override
public FileConfigurationOptions options() {