Top Description Fields Constructors Methods
org.snakeyaml.engine.v2.api

public Class Dump

Additional top-level class in compilation unit: StreamToStringWriter.

extends Object
Class Inheritance
Imports
java.io.StringWriter, java.util.Collections, .Iterator, .Objects, org.snakeyaml.engine.v2.emitter.Emitter, org.snakeyaml.engine.v2.nodes.Node, org.snakeyaml.engine.v2.representer.BaseRepresenter, .StandardRepresenter, org.snakeyaml.engine.v2.serializer.Serializer

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

Modifier and TypeField and Description
protected BaseRepresenter
representer

The component to translate Java instances to Nodes

protected DumpSettings
settings

Configuration options

Constructor Summary

AccessConstructor and Description
public
Dump(DumpSettings
- configuration
settings
)

Create instance

public
Dump(DumpSettings
- configuration
settings
,
BaseRepresenter
- custom representer
representer
)

Create instance

Method Summary

Modifier and TypeMethod and Description
public void
dump(Object
- instance to serialize
yaml
,
StreamDataWriter
- destination I/O writer
streamDataWriter
)

Dump a single instance into a YAML document

public void
dumpAll(Iterator<? extends Object>
- instances to serialize
instancesIterator
,
StreamDataWriter
- destination I/O writer
streamDataWriter
)

Dump all the instances from the iterator into a stream with every instance in a separate YAML document

public String

Returns:

String representation of the YAML stream
dumpAllToString
(Iterator<? extends Object>
- instances to serialize
instancesIterator
)

Dump all the instances from the iterator into a stream with every instance in a separate YAML document

public void
dumpNode(Node
- YAML node to be serialized to YAML document
node
,
StreamDataWriter
- stream to write to
streamDataWriter
)

Dump the provided Node into a YAML stream.

public String

Returns:

String representation of the YAML stream
dumpToString
(Object
- instance to serialize
yaml
)

Dump all the instances from the iterator into a stream with every instance in a separate YAML document

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

representerback to summary
protected BaseRepresenter representer

The component to translate Java instances to Nodes

settingsback to summary
protected DumpSettings settings

Configuration options

Constructor Detail

Dumpback to summary
public Dump(DumpSettings settings)

Create instance

Parameters
settings:DumpSettings

- configuration

Dumpback to summary
public Dump(DumpSettings settings, BaseRepresenter representer)

Create instance

Parameters
settings:DumpSettings

- configuration

representer:BaseRepresenter

- custom representer

Method Detail

dumpback to summary
public void dump(Object yaml, StreamDataWriter streamDataWriter)

Dump a single instance into a YAML document

Parameters
yaml:Object

- instance to serialize

streamDataWriter:StreamDataWriter

- destination I/O writer

dumpAllback to summary
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:Iterator<? extends Object>

- instances to serialize

streamDataWriter:StreamDataWriter

- destination I/O writer

dumpAllToStringback to summary
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:Iterator<? extends Object>

- instances to serialize

Returns:String

String representation of the YAML stream

dumpNodeback to summary
public void dumpNode(Node node, StreamDataWriter streamDataWriter)

Dump the provided Node into a YAML stream.

Parameters
node:Node

- YAML node to be serialized to YAML document

streamDataWriter:StreamDataWriter

- stream to write to

dumpToStringback to summary
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:Object

- instance to serialize

Returns:String

String representation of the YAML stream