Package org.snakeyaml.engine.v2.api
Class Dump
- java.lang.Object
-
- org.snakeyaml.engine.v2.api.Dump
-
public class Dump extends Object
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
Fields Modifier and Type Field Description protected BaseRepresenterrepresenterThe component to translate Java instances to Nodesprotected DumpSettingssettingsConfiguration options
-
Constructor Summary
Constructors Constructor Description Dump(DumpSettings settings)Create instanceDump(DumpSettings settings, BaseRepresenter representer)Create instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(Object yaml, StreamDataWriter streamDataWriter)Dump a single instance into a YAML documentvoiddumpAll(Iterator<? extends Object> instancesIterator, StreamDataWriter streamDataWriter)Dump all the instances from the iterator into a stream with every instance in a separate YAML documentStringdumpAllToString(Iterator<? extends Object> instancesIterator)Dump all the instances from the iterator into a stream with every instance in a separate YAML documentvoiddumpNode(org.snakeyaml.engine.v2.nodes.Node node, StreamDataWriter streamDataWriter)Dump the provided Node into a YAML stream.StringdumpToString(Object yaml)Dump all the instances from the iterator into a stream with every instance in a separate YAML document
-
-
-
Field Detail
-
settings
protected DumpSettings settings
Configuration options
-
representer
protected BaseRepresenter representer
The component to translate Java instances to Nodes
-
-
Constructor Detail
-
Dump
public Dump(DumpSettings settings)
Create instance- Parameters:
settings- - configuration
-
Dump
public Dump(DumpSettings settings, BaseRepresenter representer)
Create instance- Parameters:
settings- - configurationrepresenter- - custom representer
-
-
Method Detail
-
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
public void dump(Object yaml, StreamDataWriter streamDataWriter)
Dump a single instance into a YAML document- Parameters:
yaml- - instance to serializestreamDataWriter- - destination I/O writer
-
dumpAllToString
public String dumpAllToString(Iterator<? extends Object> instancesIterator)
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
public String dumpToString(Object yaml)
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
public void dumpNode(org.snakeyaml.engine.v2.nodes.Node node, StreamDataWriter streamDataWriter)Dump the provided Node into a YAML stream.- Parameters:
node- - YAML node to be serialized to YAML documentstreamDataWriter- - stream to write to
-
-