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 Details

    • settings

      protected DumpSettings settings
      Configuration options
    • representer

      protected BaseRepresenter representer
      The component to translate Java instances to Nodes
  • Constructor Details

    • Dump

      public Dump(DumpSettings settings)
      Create instance
      Parameters:
      settings - - configuration
    • Dump

      public Dump(DumpSettings settings, BaseRepresenter representer)
      Create instance
      Parameters:
      settings - - configuration
      representer - - 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 serialize
      streamDataWriter - - destination I/O writer
    • dump

      public void dump(Object yaml, StreamDataWriter streamDataWriter)
      Dump a single instance into a YAML document
      Parameters:
      yaml - - instance to serialize
      streamDataWriter - - 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(Node node, StreamDataWriter streamDataWriter)
      Dump the provided Node into a YAML stream.
      Parameters:
      node - - YAML node to be serialized to YAML document
      streamDataWriter - - stream to write to