Class YamlConfigurationOptions
YamlConfiguration- Author:
- Bukkit, Carleslc
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOptions to configure the defaultQuoteStylefor each type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedYamlConfigurationOptions(YamlConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionGets the comment formatter used to format comments.commentFormatter(YamlCommentFormatter commentFormatter) Sets the comment formatter to be used to format comments.Returns theConfigurationthat this object is responsible for.copyDefaults(boolean value) Sets if theConfigurationshould copy values from its defaultConfigurationdirectly.copyHeader(boolean value) Sets whether or not the header should be copied from a default source.booleaninthashCode()Sets the header that will be applied to the top of the saved output.Gets the header format used for parsing and dumping the header.headerFormatter(CommentFormatter headerFormatter) Sets the header format used for parsing and dumping the header.indent(int value) Sets how much spaces should be used to indent each line.intGets how much spaces should be used to indent each list element, in addition to the line indent.indentList(int value) Sets how much spaces should be used to indent each list element, in addition to the line indent.pathSeparator(char value) Sets the char that will be used to separateConfigurationSectionsGet the quote style default options.booleanIndicates if parsing comments is enabled.useComments(boolean useComments) Sets if parsing comments is needed.Methods inherited from class org.simpleyaml.configuration.file.FileConfigurationOptions
charset, copyHeader, header, isUnicodeMethods inherited from class org.simpleyaml.configuration.ConfigurationOptions
copyDefaults, indent, pathSeparator
-
Constructor Details
-
YamlConfigurationOptions
-
-
Method Details
-
configuration
Description copied from class:ConfigurationOptionsReturns theConfigurationthat this object is responsible for.- Overrides:
configurationin classFileConfigurationOptions- Returns:
- Parent configuration
-
copyDefaults
Description copied from class:ConfigurationOptionsSets if theConfigurationshould copy values from its defaultConfigurationdirectly.If this is true, all values in the default Configuration will be directly copied, making it impossible to distinguish between values that were set and values that are provided by default. As a result,
ConfigurationSection.contains(String)will always return the same value asConfigurationSection.isSet(String). The default value is true.- Overrides:
copyDefaultsin classFileConfigurationOptions- Parameters:
value- Whether or not defaults are directly copied- Returns:
- This object, for chaining
-
pathSeparator
Description copied from class:ConfigurationOptionsSets the char that will be used to separateConfigurationSectionsThis value does not affect how the
Configurationis stored, only in how you access the data. The default value is '.'- Overrides:
pathSeparatorin classFileConfigurationOptions- Parameters:
value- Path separator- Returns:
- This object, for chaining
-
charset
- Overrides:
charsetin classFileConfigurationOptions
-
header
Description copied from class:FileConfigurationOptionsSets the header that will be applied to the top of the saved output.This header will be commented out and applied directly at the top of the generated output of the
FileConfiguration. It is not required to include a newline at the end of the header as it will automatically be applied, but you may include one if you wish for extra spacing.Null is a valid header which will indicate that no header is to be applied.
- Overrides:
headerin classFileConfigurationOptions- Parameters:
header- New header- Returns:
- This object, for chaining
-
copyHeader
Description copied from class:FileConfigurationOptionsSets whether or not the header should be copied from a default source.If this is true, if a default
FileConfigurationis passed toMemoryConfiguration.setDefaults(Configuration)then upon saving it will use the header from that config, instead of the one provided here.If no default is set on the configuration, or the default is not of type FileConfiguration, or that config has no header (
FileConfigurationOptions.header()returns null) then the header specified in this configuration will be used.Defaults to true.
- Overrides:
copyHeaderin classFileConfigurationOptions- Parameters:
value- Whether or not to copy the header- Returns:
- This object, for chaining
-
headerFormatter
Description copied from class:FileConfigurationOptionsSets the header format used for parsing and dumping the header.- Overrides:
headerFormatterin classFileConfigurationOptions- Parameters:
headerFormatter- The header formatter- Returns:
- This object, for chaining
-
headerFormatter
Description copied from class:FileConfigurationOptionsGets the header format used for parsing and dumping the header.- Overrides:
headerFormatterin classFileConfigurationOptions- Returns:
- The header formatter
-
indent
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:
indentin classConfigurationOptions- 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
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
Gets the comment formatter used to format comments. The default comment formatter isYamlCommentFormat.DEFAULT, which comment prefix is "# ", i.e. a # followed by a space.- Returns:
- the comment formatter
-
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
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. WithYamlFileit 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. WithYamlFileit is updated automatically when you load a file with comments or set new comments programmatically.- Returns:
- This object, for chaining
- See Also:
-
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
- Overrides:
equalsin classFileConfigurationOptions
-
hashCode
public int hashCode()- Overrides:
hashCodein classFileConfigurationOptions
-