Class 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.
    • 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 document
      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
      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
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - - configuration
        representer - - 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 serialize
        streamDataWriter - - 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 serialize
        streamDataWriter - - 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 document
        streamDataWriter - - stream to write to