public class DumperOptions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DumperOptions.FlowStyle
Block styles use indentation to denote nesting and scope within the document.
|
static class |
DumperOptions.LineBreak
Platform dependent line break.
|
static class |
DumperOptions.NonPrintableStyle |
static class |
DumperOptions.ScalarStyle
YAML provides a rich set of scalar styles.
|
static class |
DumperOptions.Version
Specification version.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
allowReadOnlyProperties |
private boolean |
allowUnicode |
private AnchorGenerator |
anchorGenerator |
private int |
bestWidth |
private boolean |
canonical |
private DumperOptions.FlowStyle |
defaultFlowStyle |
private DumperOptions.ScalarStyle |
defaultStyle |
private boolean |
explicitEnd |
private boolean |
explicitStart |
private int |
indent |
private boolean |
indentWithIndicator |
private int |
indicatorIndent |
private DumperOptions.LineBreak |
lineBreak |
private int |
maxSimpleKeyLength |
private DumperOptions.NonPrintableStyle |
nonPrintableStyle |
private java.lang.Boolean |
prettyFlow |
private boolean |
processComments |
private boolean |
splitLines |
private java.util.Map<java.lang.String,java.lang.String> |
tags |
private java.util.TimeZone |
timeZone |
private DumperOptions.Version |
version |
Constructor and Description |
---|
DumperOptions() |
Modifier and Type | Method and Description |
---|---|
AnchorGenerator |
getAnchorGenerator() |
DumperOptions.FlowStyle |
getDefaultFlowStyle() |
DumperOptions.ScalarStyle |
getDefaultScalarStyle() |
int |
getIndent() |
boolean |
getIndentWithIndicator() |
int |
getIndicatorIndent() |
DumperOptions.LineBreak |
getLineBreak() |
int |
getMaxSimpleKeyLength() |
DumperOptions.NonPrintableStyle |
getNonPrintableStyle() |
boolean |
getSplitLines() |
java.util.Map<java.lang.String,java.lang.String> |
getTags() |
java.util.TimeZone |
getTimeZone() |
DumperOptions.Version |
getVersion() |
int |
getWidth() |
boolean |
isAllowReadOnlyProperties()
Report whether read-only JavaBean properties (the ones without setters) should be included in
the YAML document
|
boolean |
isAllowUnicode() |
boolean |
isCanonical() |
boolean |
isExplicitEnd() |
boolean |
isExplicitStart() |
boolean |
isPrettyFlow() |
boolean |
isProcessComments() |
void |
setAllowReadOnlyProperties(boolean allowReadOnlyProperties)
Set to true to include read-only JavaBean properties (the ones without setters) in the YAML
document.
|
void |
setAllowUnicode(boolean allowUnicode)
Specify whether to emit non-ASCII printable Unicode characters.
|
void |
setAnchorGenerator(AnchorGenerator anchorGenerator) |
void |
setCanonical(boolean canonical)
Force the emitter to produce a canonical YAML document.
|
void |
setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle) |
void |
setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
Set default style for scalars.
|
void |
setExplicitEnd(boolean explicitEnd) |
void |
setExplicitStart(boolean explicitStart) |
void |
setIndent(int indent) |
void |
setIndentWithIndicator(boolean indentWithIndicator)
Set to true to add the indent for sequences to the general indent
|
void |
setIndicatorIndent(int indicatorIndent)
Set number of white spaces to use for the sequence indicator '-'
|
void |
setLineBreak(DumperOptions.LineBreak lineBreak)
Specify the line break to separate the lines.
|
void |
setMaxSimpleKeyLength(int maxSimpleKeyLength)
Define max key length to use simple key (without '?') More info
https://yaml.org/spec/1.1/#id934537
|
void |
setNonPrintableStyle(DumperOptions.NonPrintableStyle style)
When String contains non-printable characters SnakeYAML convert it to binary data with the
!!binary tag.
|
void |
setPrettyFlow(boolean prettyFlow)
Force the emitter to produce a pretty YAML document when using the flow style.
|
void |
setProcessComments(boolean processComments)
Set the comment processing.
|
void |
setSplitLines(boolean splitLines)
Specify whether to split lines exceeding preferred width for scalars.
|
void |
setTags(java.util.Map<java.lang.String,java.lang.String> tags) |
void |
setTimeZone(java.util.TimeZone timeZone)
Set the timezone to be used for Date.
|
void |
setVersion(DumperOptions.Version version) |
void |
setWidth(int bestWidth)
Specify the preferred width to emit scalars.
|
private DumperOptions.ScalarStyle defaultStyle
private DumperOptions.FlowStyle defaultFlowStyle
private boolean canonical
private boolean allowUnicode
private boolean allowReadOnlyProperties
private int indent
private int indicatorIndent
private boolean indentWithIndicator
private int bestWidth
private boolean splitLines
private DumperOptions.LineBreak lineBreak
private boolean explicitStart
private boolean explicitEnd
private java.util.TimeZone timeZone
private int maxSimpleKeyLength
private boolean processComments
private DumperOptions.NonPrintableStyle nonPrintableStyle
private DumperOptions.Version version
private java.util.Map<java.lang.String,java.lang.String> tags
private java.lang.Boolean prettyFlow
private AnchorGenerator anchorGenerator
public boolean isAllowUnicode()
public void setAllowUnicode(boolean allowUnicode)
allowUnicode
- if allowUnicode is false then all non-ASCII characters are escapedpublic DumperOptions.ScalarStyle getDefaultScalarStyle()
public void setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
defaultStyle
- set the style for all scalarspublic void setIndent(int indent)
public int getIndent()
public void setIndicatorIndent(int indicatorIndent)
indicatorIndent
- value to be used as indentpublic int getIndicatorIndent()
public boolean getIndentWithIndicator()
public void setIndentWithIndicator(boolean indentWithIndicator)
indentWithIndicator
- - true when indent for sequences is added to generalpublic void setVersion(DumperOptions.Version version)
public DumperOptions.Version getVersion()
public void setCanonical(boolean canonical)
canonical
- true produce canonical YAML documentpublic boolean isCanonical()
public void setPrettyFlow(boolean prettyFlow)
prettyFlow
- true produce pretty flow YAML documentpublic boolean isPrettyFlow()
public void setWidth(int bestWidth)
bestWidth
- the preferred width for scalars.public int getWidth()
public void setSplitLines(boolean splitLines)
splitLines
- whether to split lines exceeding preferred width for scalars.public boolean getSplitLines()
public DumperOptions.LineBreak getLineBreak()
public void setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)
public DumperOptions.FlowStyle getDefaultFlowStyle()
public void setLineBreak(DumperOptions.LineBreak lineBreak)
lineBreak
- to be used for the inputpublic boolean isExplicitStart()
public void setExplicitStart(boolean explicitStart)
public boolean isExplicitEnd()
public void setExplicitEnd(boolean explicitEnd)
public java.util.Map<java.lang.String,java.lang.String> getTags()
public void setTags(java.util.Map<java.lang.String,java.lang.String> tags)
public boolean isAllowReadOnlyProperties()
public void setAllowReadOnlyProperties(boolean allowReadOnlyProperties)
allowReadOnlyProperties
- - true to dump read-only JavaBean propertiespublic java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone timeZone)
null
UTC is used.timeZone
- for created Dates or null to use UTCpublic AnchorGenerator getAnchorGenerator()
public void setAnchorGenerator(AnchorGenerator anchorGenerator)
public int getMaxSimpleKeyLength()
public void setMaxSimpleKeyLength(int maxSimpleKeyLength)
maxSimpleKeyLength
- - the limit after which the key gets explicit key indicator '?'public void setProcessComments(boolean processComments)
processComments
- true
to process; false
to ignorepublic boolean isProcessComments()
public DumperOptions.NonPrintableStyle getNonPrintableStyle()
public void setNonPrintableStyle(DumperOptions.NonPrintableStyle style)
style
- ESCAPE to force SnakeYAML to keep !!str tag for non-printable data