Class YamlConfigurationOptions

java.lang.Object
org.simpleyaml.configuration.ConfigurationOptions
org.simpleyaml.configuration.MemoryConfigurationOptions
org.simpleyaml.configuration.file.FileConfigurationOptions
org.simpleyaml.configuration.file.YamlConfigurationOptions

public class YamlConfigurationOptions extends org.simpleyaml.configuration.file.FileConfigurationOptions
Various settings for controlling the input and output of a YamlConfiguration
Author:
Bukkit, Carleslc
See Also:
  • Constructor Details

    • YamlConfigurationOptions

      protected YamlConfigurationOptions(YamlConfiguration configuration)
  • Method Details

    • configuration

      public YamlConfiguration configuration()
      Overrides:
      configuration in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • copyDefaults

      public YamlConfigurationOptions copyDefaults(boolean value)
      Overrides:
      copyDefaults in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • pathSeparator

      public YamlConfigurationOptions pathSeparator(char value)
      Overrides:
      pathSeparator in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • charset

      public YamlConfigurationOptions charset(Charset charset)
      Overrides:
      charset in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • header

      public YamlConfigurationOptions header(String header)
      Overrides:
      header in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • copyHeader

      public YamlConfigurationOptions copyHeader(boolean value)
      Overrides:
      copyHeader in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • headerFormatter

      public YamlConfigurationOptions headerFormatter(org.simpleyaml.configuration.comments.format.CommentFormatter headerFormatter)
      Overrides:
      headerFormatter in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • headerFormatter

      public YamlHeaderFormatter headerFormatter()
      Overrides:
      headerFormatter in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • indent

      public YamlConfigurationOptions indent(int value)
      Sets how much spaces should be used to indent each line.

      The minimum value this may be is 2, and the maximum is 9.

      Overrides:
      indent in class org.simpleyaml.configuration.ConfigurationOptions
      Parameters:
      value - New indent
      Returns:
      This object, for chaining
    • indentList

      public int indentList()
      Gets how much spaces should be used to indent each list element, in addition to the line indent.
      Returns:
      the list elements indentation
    • indentList

      public YamlConfigurationOptions indentList(int value)
      Sets how much spaces should be used to indent each list element, in addition to the line indent.

      The minimum value this may be is 0, and the maximum is the same as the ConfigurationOptions.indent().

      Parameters:
      value - New list indentation
      Returns:
      This object, for chaining
    • commentFormatter

      public YamlCommentFormatter commentFormatter()
      Gets the comment formatter used to format comments.

      The default comment formatter is YamlCommentFormat.DEFAULT, which comment prefix is "# ", i.e. a # followed by a space.

      Returns:
      the comment formatter
    • commentFormatter

      public YamlConfigurationOptions commentFormatter(YamlCommentFormatter commentFormatter)
      Sets the comment formatter to be used to format comments.

      If unset, the default comment formatter prefix is "# ", i.e. a # followed by a space.

      Parameters:
      commentFormatter - the comment formatter to use
      Returns:
      This object, for chaining
    • useComments

      public YamlConfigurationOptions useComments(boolean useComments)
      Sets if parsing comments is needed.

      If you don't use comments in your configuration file keep this disabled to improve parsing performance.

      Default is false.

      With YamlFile it is updated automatically when you load a file with comments or set new comments programmatically.

      Parameters:
      useComments - if parsing comments is needed
      Returns:
      This object, for chaining
    • useComments

      public boolean useComments()
      Indicates if parsing comments is enabled.

      If you don't use comments in your configuration file keep this disabled to improve parsing performance.

      Default is false.

      With YamlFile it is updated automatically when you load a file with comments or set new comments programmatically.

      Returns:
      This object, for chaining
      See Also:
    • quoteStyleDefaults

      public YamlConfigurationOptions.QuoteStyleDefaults quoteStyleDefaults()
      Get the quote style default options.

      You can change the default quote style globally or for specific value types.

      Returns:
      the quote style default options
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.simpleyaml.configuration.file.FileConfigurationOptions
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.simpleyaml.configuration.file.FileConfigurationOptions