Package org.snakeyaml.engine.v2.api
Class Dump
- java.lang.Object
-
- org.snakeyaml.engine.v2.api.Dump
-
public class Dump extends java.lang.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 BaseRepresenter
representer
The component to translate Java instances to Nodesprotected DumpSettings
settings
Configuration 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 void
dump(java.lang.Object yaml, StreamDataWriter streamDataWriter)
Dump a single instance into a YAML documentvoid
dumpAll(java.util.Iterator<? extends java.lang.Object> instancesIterator, StreamDataWriter streamDataWriter)
Dump all the instances from the iterator into a stream with every instance in a separate YAML documentjava.lang.String
dumpAllToString(java.util.Iterator<? extends java.lang.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.java.lang.String
dumpToString(java.lang.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(java.util.Iterator<? extends java.lang.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(java.lang.Object yaml, StreamDataWriter streamDataWriter)
Dump a single instance into a YAML document- Parameters:
yaml
- - instance to serializestreamDataWriter
- - destination I/O writer
-
dumpAllToString
public java.lang.String dumpAllToString(java.util.Iterator<? extends java.lang.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 java.lang.String dumpToString(java.lang.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(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
-
-