Interface LoadableConfiguration

All Known Implementing Classes:
FileConfiguration

public interface LoadableConfiguration
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    load(Reader reader)
    Loads this configuration from the specified reader.
    void
    Loads this configuration from the specified string.
    void
    save(Writer writer)
    Saves this configuration to a writer.
    Saves this configuration to a string, and returns it.
  • Method Details

    • loadFromString

      void loadFromString(String contents) throws IOException, InvalidConfigurationException
      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

      String saveToString() throws IOException
      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

      void save(Writer writer) throws IOException
      Saves this configuration to a writer.
      Parameters:
      writer - where to save this configuration
      Throws:
      IOException - when the contents cannot be written for any reason.