Package org.snakeyaml.engine.v2.api
Class Dump
java.lang.Object
org.snakeyaml.engine.v2.api.Dump
Common way to serialize any Java instance(s). The instance is stateful. Only one of the 'dump'
methods may be called, and it may be called only once.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BaseRepresenter
The component to translate Java instances to Nodesprotected DumpSettings
Configuration options -
Constructor Summary
ConstructorsConstructorDescriptionDump
(DumpSettings settings) Create instanceDump
(DumpSettings settings, BaseRepresenter representer) Create instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
dump
(Object yaml, StreamDataWriter streamDataWriter) Dump a single instance into a YAML documentvoid
dumpAll
(Iterator<? extends Object> instancesIterator, StreamDataWriter streamDataWriter) Dump all the instances from the iterator into a stream with every instance in a separate YAML documentdumpAllToString
(Iterator<? extends Object> instancesIterator) Dump all the instances from the iterator into a stream with every instance in a separate YAML documentvoid
dumpNode
(Node node, StreamDataWriter streamDataWriter) Dump the provided Node into a YAML stream.dumpToString
(Object yaml) Dump all the instances from the iterator into a stream with every instance in a separate YAML document
-
Field Details
-
settings
Configuration options -
representer
The component to translate Java instances to Nodes
-
-
Constructor Details
-
Dump
Create instance- Parameters:
settings
- - configuration
-
Dump
Create instance- Parameters:
settings
- - configurationrepresenter
- - custom representer
-
-
Method Details
-
dumpAll
public void dumpAll(Iterator<? extends Object> instancesIterator, StreamDataWriter streamDataWriter) Dump all the instances from the iterator into a stream with every instance in a separate YAML document- Parameters:
instancesIterator
- - instances to serializestreamDataWriter
- - destination I/O writer
-
dump
Dump a single instance into a YAML document- Parameters:
yaml
- - instance to serializestreamDataWriter
- - destination I/O writer
-
dumpAllToString
Dump all the instances from the iterator into a stream with every instance in a separate YAML document- Parameters:
instancesIterator
- - instances to serialize- Returns:
- String representation of the YAML stream
-
dumpToString
Dump all the instances from the iterator into a stream with every instance in a separate YAML document- Parameters:
yaml
- - instance to serialize- Returns:
- String representation of the YAML stream
-
dumpNode
Dump the provided Node into a YAML stream.- Parameters:
node
- - YAML node to be serialized to YAML documentstreamDataWriter
- - stream to write to
-