Class 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.
    • 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​(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
        streamDataWriter - - stream to write to