public class YamlConfigurationOptions extends FileConfigurationOptions
YamlConfiguration
Modifier and Type | Class and Description |
---|---|
static class |
YamlConfigurationOptions.QuoteStyleDefaults
Options to configure the default
QuoteStyle for each type. |
Modifier | Constructor and Description |
---|---|
protected |
YamlConfigurationOptions(YamlConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
YamlConfigurationOptions |
charset(Charset charset) |
YamlCommentFormatter |
commentFormatter()
Gets the comment formatter used to format comments.
|
YamlConfigurationOptions |
commentFormatter(YamlCommentFormatter commentFormatter)
Sets the comment formatter to be used to format comments.
|
YamlConfiguration |
configuration()
Returns the
Configuration that this object is responsible for. |
YamlConfigurationOptions |
copyDefaults(boolean value)
Sets if the
Configuration should copy values from its default
Configuration directly. |
YamlConfigurationOptions |
copyHeader(boolean value)
Sets whether or not the header should be copied from a default source.
|
boolean |
equals(Object o) |
int |
hashCode() |
YamlConfigurationOptions |
header(String header)
Sets the header that will be applied to the top of the saved output.
|
YamlHeaderFormatter |
headerFormatter()
Gets the header format used for parsing and dumping the header.
|
YamlConfigurationOptions |
headerFormatter(CommentFormatter headerFormatter)
Sets the header format used for parsing and dumping the header.
|
YamlConfigurationOptions |
indent(int value)
Sets how much spaces should be used to indent each line.
|
int |
indentList()
Gets how much spaces should be used to indent each list element, in addition to the line indent.
|
YamlConfigurationOptions |
indentList(int value)
Sets how much spaces should be used to indent each list element, in addition to the line indent.
|
YamlConfigurationOptions |
pathSeparator(char value)
Sets the char that will be used to separate
ConfigurationSection s
This value does not affect how the Configuration is stored,
only in how you access the data. |
YamlConfigurationOptions.QuoteStyleDefaults |
quoteStyleDefaults()
Get the quote style default options.
|
boolean |
useComments()
Indicates if parsing comments is enabled.
|
YamlConfigurationOptions |
useComments(boolean useComments)
Sets if parsing comments is needed.
|
charset, copyHeader, header, isUnicode
copyDefaults, indent, pathSeparator
protected YamlConfigurationOptions(YamlConfiguration configuration)
public YamlConfiguration configuration()
ConfigurationOptions
Configuration
that this object is responsible for.configuration
in class FileConfigurationOptions
public YamlConfigurationOptions copyDefaults(boolean value)
ConfigurationOptions
Configuration
should copy values from its default
Configuration
directly.
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 as ConfigurationSection.isSet(String)
. The default value is
true.
copyDefaults
in class FileConfigurationOptions
value
- Whether or not defaults are directly copiedpublic YamlConfigurationOptions pathSeparator(char value)
ConfigurationOptions
ConfigurationSection
s
This value does not affect how the Configuration
is stored,
only in how you access the data. The default value is '.'
pathSeparator
in class FileConfigurationOptions
value
- Path separatorpublic YamlConfigurationOptions charset(Charset charset)
charset
in class FileConfigurationOptions
public YamlConfigurationOptions header(String header)
FileConfigurationOptions
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.
header
in class FileConfigurationOptions
header
- New headerpublic YamlConfigurationOptions copyHeader(boolean value)
FileConfigurationOptions
If this is true, if a default FileConfiguration
is passed to
MemoryConfiguration.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.
copyHeader
in class FileConfigurationOptions
value
- Whether or not to copy the headerpublic YamlConfigurationOptions headerFormatter(CommentFormatter headerFormatter)
FileConfigurationOptions
headerFormatter
in class FileConfigurationOptions
headerFormatter
- The header formatterpublic YamlHeaderFormatter headerFormatter()
FileConfigurationOptions
headerFormatter
in class FileConfigurationOptions
public YamlConfigurationOptions indent(int value)
The minimum value this may be is 2, and the maximum is 9.
indent
in class ConfigurationOptions
value
- New indentpublic int indentList()
public YamlConfigurationOptions indentList(int value)
The minimum value this may be is 0, and the maximum is the same as the ConfigurationOptions.indent()
.
value
- New list indentationpublic YamlCommentFormatter commentFormatter()
YamlCommentFormat.DEFAULT
, which comment prefix is "# ", i.e. a # followed by a space.public YamlConfigurationOptions commentFormatter(YamlCommentFormatter commentFormatter)
commentFormatter
- the comment formatter to usepublic YamlConfigurationOptions useComments(boolean useComments)
If you don't use comments in your configuration file keep this disabled to improve parsing performance.
Default is false. WithYamlFile
it is updated automatically when you load a file with comments or set new comments programmatically.useComments
- if parsing comments is neededpublic boolean useComments()
If you don't use comments in your configuration file keep this disabled to improve parsing performance.
Default is false. WithYamlFile
it is updated automatically when you load a file with comments or set new comments programmatically.useComments(boolean)
public YamlConfigurationOptions.QuoteStyleDefaults quoteStyleDefaults()
QuoteStyle.PLAIN
,
QuoteStyle.SINGLE
,
QuoteStyle.DOUBLE
public boolean equals(Object o)
equals
in class FileConfigurationOptions
public int hashCode()
hashCode
in class FileConfigurationOptions
Copyright © 2023. All rights reserved.