Package org.yaml.snakeyaml.emitter
Class Emitter
java.lang.Object
org.yaml.snakeyaml.emitter.Emitter
- All Implemented Interfaces:
Emitable
Emitter expects events obeying the following grammar: stream ::= STREAM-START document* STREAM-END document ::= DOCUMENT-START node DOCUMENT-END node ::= SCALAR | sequence | mapping sequence ::= SEQUENCE-START node* SEQUENCE-END mapping ::= MAPPING-START (node node)* MAPPING-END
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private ScalarAnalysis
private int
private final char[]
private int
private final Boolean
private int
private Event
private int
private static final Pattern
private Integer
private boolean
private final ArrayStack<Integer>
private final boolean
private final int
private boolean
static final int
private final int
static final int
private boolean
private String
private String
private final Boolean
private boolean
private boolean
private static final char[]
private static final Pattern
private final boolean
private EmitterState
private final ArrayStack<EmitterState>
private final Writer
private DumperOptions.ScalarStyle
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ScalarAnalysis
analyzeScalar
(String scalar) private boolean
private boolean
private boolean
private boolean
private DumperOptions.ScalarStyle
private String
determineBlockHints
(String text) void
private void
private void
private void
private void
private void
private void
expectNode
(boolean root, boolean mapping, boolean simpleKey) private void
(package private) void
private void
increaseIndent
(boolean flow, boolean indentless) private boolean
needEvents
(int count) private boolean
(package private) static String
prepareAnchor
(String anchor) private String
prepareTag
(String tag) private String
prepareTagHandle
(String handle) private String
prepareTagPrefix
(String prefix) private String
prepareVersion
(DumperOptions.Version version) private void
processAnchor
(String indicator) private void
private void
private void
writeDoubleQuoted
(String text, boolean split) (package private) void
writeFolded
(String text, boolean split) (package private) void
(package private) void
writeIndicator
(String indicator, boolean needWhitespace, boolean whitespace, boolean indentation) private void
writeLineBreak
(String data) (package private) void
writeLiteral
(String text) (package private) void
writePlain
(String text, boolean split) private void
writeSingleQuoted
(String text, boolean split) (package private) void
(package private) void
(package private) void
writeTagDirective
(String handleText, String prefixText) (package private) void
writeVersionDirective
(String versionText) private void
writeWhitespace
(int length)
-
Field Details
-
MIN_INDENT
public static final int MIN_INDENT- See Also:
-
MAX_INDENT
public static final int MAX_INDENT- See Also:
-
SPACE
private static final char[] SPACE -
SPACES_PATTERN
-
INVALID_ANCHOR
-
ESCAPE_REPLACEMENTS
-
DEFAULT_TAG_PREFIXES
-
stream
-
states
-
state
-
events
-
event
-
indents
-
indent
-
flowLevel
private int flowLevel -
rootContext
private boolean rootContext -
mappingContext
private boolean mappingContext -
simpleKeyContext
private boolean simpleKeyContext -
column
private int column -
whitespace
private boolean whitespace -
indention
private boolean indention -
openEnded
private boolean openEnded -
canonical
-
prettyFlow
-
allowUnicode
private final boolean allowUnicode -
bestIndent
private int bestIndent -
indicatorIndent
private final int indicatorIndent -
indentWithIndicator
private final boolean indentWithIndicator -
bestWidth
private int bestWidth -
bestLineBreak
private final char[] bestLineBreak -
splitLines
private final boolean splitLines -
maxSimpleKeyLength
private final int maxSimpleKeyLength -
tagPrefixes
-
preparedAnchor
-
preparedTag
-
analysis
-
style
-
HANDLE_FORMAT
-
-
Constructor Details
-
Emitter
-
-
Method Details
-
emit
- Specified by:
emit
in interfaceEmitable
- Throws:
IOException
-
needMoreEvents
private boolean needMoreEvents() -
needEvents
private boolean needEvents(int count) -
increaseIndent
private void increaseIndent(boolean flow, boolean indentless) -
expectNode
- Throws:
IOException
-
expectAlias
- Throws:
IOException
-
expectScalar
- Throws:
IOException
-
expectFlowSequence
- Throws:
IOException
-
expectFlowMapping
- Throws:
IOException
-
expectBlockSequence
- Throws:
IOException
-
expectBlockMapping
- Throws:
IOException
-
checkEmptySequence
private boolean checkEmptySequence() -
checkEmptyMapping
private boolean checkEmptyMapping() -
checkEmptyDocument
private boolean checkEmptyDocument() -
checkSimpleKey
private boolean checkSimpleKey() -
processAnchor
- Throws:
IOException
-
processTag
- Throws:
IOException
-
chooseScalarStyle
-
processScalar
- Throws:
IOException
-
prepareVersion
-
prepareTagHandle
-
prepareTagPrefix
-
prepareTag
-
prepareAnchor
-
analyzeScalar
-
flushStream
- Throws:
IOException
-
writeStreamStart
void writeStreamStart() -
writeStreamEnd
- Throws:
IOException
-
writeIndicator
void writeIndicator(String indicator, boolean needWhitespace, boolean whitespace, boolean indentation) throws IOException - Throws:
IOException
-
writeIndent
- Throws:
IOException
-
writeWhitespace
- Throws:
IOException
-
writeLineBreak
- Throws:
IOException
-
writeVersionDirective
- Throws:
IOException
-
writeTagDirective
- Throws:
IOException
-
writeSingleQuoted
- Throws:
IOException
-
writeDoubleQuoted
- Throws:
IOException
-
determineBlockHints
-
writeFolded
- Throws:
IOException
-
writeLiteral
- Throws:
IOException
-
writePlain
- Throws:
IOException
-