Class Emitter

  • All Implemented Interfaces:
    Emitable

    public final class Emitter
    extends java.lang.Object
    implements Emitable
     Emitter expects events obeying the following grammar:
     stream ::= STREAM-START document* STREAM-END
     document ::= DOCUMENT-START node DOCUMENT-END
     node ::= SCALAR | sequence | mapping
     sequence ::= SEQUENCE-START node* SEQUENCE-END
     mapping ::= MAPPING-START (node node)* MAPPING-END
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAX_INDENT
      indent should not be more than 10 spaces
      static int MIN_INDENT
      indent cannot be zero spaces
    • Constructor Summary

      Constructors 
      Constructor Description
      Emitter​(java.io.Writer stream, DumperOptions opts)
      Create
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void emit​(Event event)
      Serialise event to bytes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MIN_INDENT

        public static final int MIN_INDENT
        indent cannot be zero spaces
        See Also:
        Constant Field Values
      • MAX_INDENT

        public static final int MAX_INDENT
        indent should not be more than 10 spaces
        See Also:
        Constant Field Values
    • Constructor Detail

      • Emitter

        public Emitter​(java.io.Writer stream,
                       DumperOptions opts)
        Create
        Parameters:
        stream - - output to write to
        opts - - options
    • Method Detail

      • emit

        public void emit​(Event event)
                  throws java.io.IOException
        Description copied from interface: Emitable
        Serialise event to bytes
        Specified by:
        emit in interface Emitable
        Parameters:
        event - - the source
        Throws:
        java.io.IOException - if bytes bite