public final class ConfigRenderOptions extends java.lang.Object
A set of options related to rendering a ConfigValue
. Passed to
ConfigValue.render(ConfigRenderOptions)
.
Here is an example of creating a ConfigRenderOptions
:
ConfigRenderOptions options = ConfigRenderOptions.defaults().setComments(false)
Modifier and Type | Method and Description |
---|---|
static ConfigRenderOptions |
concise()
Returns concise render options (no whitespace or comments).
|
static ConfigRenderOptions |
defaults()
Returns the default render options which are verbose (commented and
formatted).
|
boolean |
getComments()
Returns whether the options enable comments.
|
boolean |
getFormatted()
Returns whether the options enable formatting.
|
boolean |
getJson()
Returns whether the options enable JSON.
|
boolean |
getOriginComments()
Returns whether the options enable automated origin comments.
|
boolean |
getShowEnvVariableValues()
Returns whether the options enable rendering of environment variable values.
|
ConfigRenderOptions |
setComments(boolean value)
Returns options with comments toggled.
|
ConfigRenderOptions |
setFormatted(boolean value)
Returns options with formatting toggled.
|
ConfigRenderOptions |
setJson(boolean value)
Returns options with JSON toggled.
|
ConfigRenderOptions |
setOriginComments(boolean value)
Returns options with origin comments toggled.
|
ConfigRenderOptions |
setShowEnvVariableValues(boolean value)
Returns options with showEnvVariableValues toggled.
|
java.lang.String |
toString() |
public static defaults()
concise()
for stripped-down
options. This rendering will not be valid JSON since it has comments.public static concise()
Config
, the concise rendering will be valid JSON.public setComments(boolean value)
setOriginComments(boolean)
.value
- true to include comments in the renderpublic boolean getComments()
public setOriginComments(boolean value)
ConfigValue.origin()
of that setting's value. For example these
comments might tell you which file a setting comes from.
setOriginComments()
controls only these autogenerated
"origin of this setting" comments, to toggle regular comments use
setComments(boolean)
.
value
- true to include autogenerated setting-origin comments in the
renderpublic boolean getOriginComments()
public setFormatted(boolean value)
value
- true to enable formattingpublic boolean getFormatted()
public setJson(boolean value)
setComments(boolean)
and setOriginComments(boolean)
options. So if you enable
comments you will get invalid JSON despite setting this to true.value
- true to include non-JSON extensions in the renderpublic setShowEnvVariableValues(boolean value)
value
- true to include environment variable values in the renderpublic boolean getShowEnvVariableValues()
public boolean getJson()
public java.lang.String toString()
toString
in class java.lang.Object