org.jvyamlb
Class EmitterImpl

java.lang.Object
  extended by org.jvyamlb.EmitterImpl
All Implemented Interfaces:
Emitter

public class EmitterImpl
extends java.lang.Object
implements Emitter

Author:
Ola Bini

Nested Class Summary
private static class EmitterImpl.EmitterEnvironment
           
private static interface EmitterImpl.EmitterState
           
private static class EmitterImpl.ScalarAnalysis
           
 
Field Summary
private static java.util.regex.Pattern ANCHOR_FORMAT
           
private static int BLOCK_MAPPING_KEY
           
private static int BLOCK_MAPPING_SIMPLE_VALUE
           
private static int BLOCK_MAPPING_VALUE
           
private static int BLOCK_SEQUENCE_ITEM
           
private static java.util.Map DEFAULT_TAG_PREFIXES_1_0
           
private static java.util.Map DEFAULT_TAG_PREFIXES_1_1
           
private static java.util.regex.Pattern DOC_INDIC
           
private static int DOCUMENT_END
           
private static int DOCUMENT_ROOT
           
private static int DOCUMENT_START
           
private  EmitterImpl.EmitterEnvironment env
           
private static int FIRST_BLOCK_MAPPING_KEY
           
private static int FIRST_BLOCK_SEQUENCE_ITEM
           
private static int FIRST_DOCUMENT_START
           
private static int FIRST_FLOW_MAPPING_KEY
           
private static int FIRST_FLOW_SEQUENCE_ITEM
           
private static java.util.regex.Pattern FIRST_SPACE
           
private static java.lang.String FLOW_INDIC
           
private static int FLOW_MAPPING_KEY
           
private static int FLOW_MAPPING_SIMPLE_VALUE
           
private static int FLOW_MAPPING_VALUE
           
private static int FLOW_SEQUENCE_ITEM
           
private static java.util.regex.Pattern HANDLE_FORMAT
           
private static int NOTHING
           
private static java.lang.String NULL_BL_T_LINEBR
           
private  YAMLConfig options
           
private static java.lang.String SPECIAL_INDIC
           
private static EmitterImpl.EmitterState[] STATES
           
private  java.io.OutputStream stream
           
private static int STREAM_START
           
 
Constructor Summary
EmitterImpl(java.io.OutputStream stream, YAMLConfig opts)
           
 
Method Summary
(package private) static EmitterImpl.ScalarAnalysis analyzeScalar(org.jruby.util.ByteList scalar)
           
(package private) static java.lang.String determineChomp(org.jruby.util.ByteList text)
           
 void emit(Event event)
           
(package private)  void flushStream()
           
 YAMLConfig getOptions()
           
static void main(java.lang.String[] args)
           
(package private) static java.lang.String prepareAnchor(java.lang.String anchor)
           
(package private)  java.lang.String prepareTag(java.lang.String tag)
           
(package private) static java.lang.String prepareTagHandle(java.lang.String handle)
           
(package private) static java.lang.String prepareTagPrefix(java.lang.String prefix)
           
(package private) static java.lang.String prepareVersion(int[] version)
           
(package private)  void writeDoubleQuoted(org.jruby.util.ByteList text, boolean split)
           
(package private)  void writeFolded(org.jruby.util.ByteList text)
           
(package private)  void writeIndent()
           
(package private)  void writeIndicator(org.jruby.util.ByteList indicator, boolean needWhitespace, boolean whitespace, boolean indentation)
           
(package private)  void writeLineBreak(org.jruby.util.ByteList data)
           
(package private)  void writeLiteral(org.jruby.util.ByteList text)
           
(package private)  void writePlain(org.jruby.util.ByteList text, boolean split)
           
(package private)  void writeSingleQuoted(org.jruby.util.ByteList text, boolean split)
           
(package private)  void writeStreamEnd()
           
(package private)  void writeStreamStart()
           
(package private)  void writeTagDirective(java.lang.String handle, java.lang.String prefix)
           
(package private)  void writeVersionDirective(java.lang.String version_text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STREAM_START

private static final int STREAM_START
See Also:
Constant Field Values

FIRST_DOCUMENT_START

private static final int FIRST_DOCUMENT_START
See Also:
Constant Field Values

DOCUMENT_ROOT

private static final int DOCUMENT_ROOT
See Also:
Constant Field Values

NOTHING

private static final int NOTHING
See Also:
Constant Field Values

DOCUMENT_START

private static final int DOCUMENT_START
See Also:
Constant Field Values

DOCUMENT_END

private static final int DOCUMENT_END
See Also:
Constant Field Values

FIRST_FLOW_SEQUENCE_ITEM

private static final int FIRST_FLOW_SEQUENCE_ITEM
See Also:
Constant Field Values

FLOW_SEQUENCE_ITEM

private static final int FLOW_SEQUENCE_ITEM
See Also:
Constant Field Values

FIRST_FLOW_MAPPING_KEY

private static final int FIRST_FLOW_MAPPING_KEY
See Also:
Constant Field Values

FLOW_MAPPING_SIMPLE_VALUE

private static final int FLOW_MAPPING_SIMPLE_VALUE
See Also:
Constant Field Values

FLOW_MAPPING_VALUE

private static final int FLOW_MAPPING_VALUE
See Also:
Constant Field Values

FLOW_MAPPING_KEY

private static final int FLOW_MAPPING_KEY
See Also:
Constant Field Values

BLOCK_SEQUENCE_ITEM

private static final int BLOCK_SEQUENCE_ITEM
See Also:
Constant Field Values

FIRST_BLOCK_MAPPING_KEY

private static final int FIRST_BLOCK_MAPPING_KEY
See Also:
Constant Field Values

BLOCK_MAPPING_SIMPLE_VALUE

private static final int BLOCK_MAPPING_SIMPLE_VALUE
See Also:
Constant Field Values

BLOCK_MAPPING_VALUE

private static final int BLOCK_MAPPING_VALUE
See Also:
Constant Field Values

BLOCK_MAPPING_KEY

private static final int BLOCK_MAPPING_KEY
See Also:
Constant Field Values

FIRST_BLOCK_SEQUENCE_ITEM

private static final int FIRST_BLOCK_SEQUENCE_ITEM
See Also:
Constant Field Values

STATES

private static final EmitterImpl.EmitterState[] STATES

DEFAULT_TAG_PREFIXES_1_0

private static final java.util.Map DEFAULT_TAG_PREFIXES_1_0

DEFAULT_TAG_PREFIXES_1_1

private static final java.util.Map DEFAULT_TAG_PREFIXES_1_1

stream

private java.io.OutputStream stream

options

private YAMLConfig options

env

private EmitterImpl.EmitterEnvironment env

HANDLE_FORMAT

private static final java.util.regex.Pattern HANDLE_FORMAT

ANCHOR_FORMAT

private static final java.util.regex.Pattern ANCHOR_FORMAT

DOC_INDIC

private static final java.util.regex.Pattern DOC_INDIC

FIRST_SPACE

private static final java.util.regex.Pattern FIRST_SPACE

NULL_BL_T_LINEBR

private static final java.lang.String NULL_BL_T_LINEBR
See Also:
Constant Field Values

SPECIAL_INDIC

private static final java.lang.String SPECIAL_INDIC
See Also:
Constant Field Values

FLOW_INDIC

private static final java.lang.String FLOW_INDIC
See Also:
Constant Field Values
Constructor Detail

EmitterImpl

public EmitterImpl(java.io.OutputStream stream,
                   YAMLConfig opts)
Method Detail

getOptions

public YAMLConfig getOptions()

emit

public void emit(Event event)
          throws java.io.IOException
Specified by:
emit in interface Emitter
Throws:
java.io.IOException

writeStreamStart

void writeStreamStart()

writeStreamEnd

void writeStreamEnd()
              throws java.io.IOException
Throws:
java.io.IOException

writeIndicator

void writeIndicator(org.jruby.util.ByteList indicator,
                    boolean needWhitespace,
                    boolean whitespace,
                    boolean indentation)
              throws java.io.IOException
Throws:
java.io.IOException

writeIndent

void writeIndent()
           throws java.io.IOException
Throws:
java.io.IOException

writeVersionDirective

void writeVersionDirective(java.lang.String version_text)
                     throws java.io.IOException
Throws:
java.io.IOException

writeTagDirective

void writeTagDirective(java.lang.String handle,
                       java.lang.String prefix)
                 throws java.io.IOException
Throws:
java.io.IOException

writeDoubleQuoted

void writeDoubleQuoted(org.jruby.util.ByteList text,
                       boolean split)
                 throws java.io.IOException
Throws:
java.io.IOException

writeSingleQuoted

void writeSingleQuoted(org.jruby.util.ByteList text,
                       boolean split)
                 throws java.io.IOException
Throws:
java.io.IOException

writeFolded

void writeFolded(org.jruby.util.ByteList text)
           throws java.io.IOException
Throws:
java.io.IOException

writeLiteral

void writeLiteral(org.jruby.util.ByteList text)
            throws java.io.IOException
Throws:
java.io.IOException

writePlain

void writePlain(org.jruby.util.ByteList text,
                boolean split)
          throws java.io.IOException
Throws:
java.io.IOException

writeLineBreak

void writeLineBreak(org.jruby.util.ByteList data)
              throws java.io.IOException
Throws:
java.io.IOException

flushStream

void flushStream()
           throws java.io.IOException
Throws:
java.io.IOException

prepareVersion

static java.lang.String prepareVersion(int[] version)

prepareTagHandle

static java.lang.String prepareTagHandle(java.lang.String handle)

prepareTagPrefix

static java.lang.String prepareTagPrefix(java.lang.String prefix)

prepareAnchor

static java.lang.String prepareAnchor(java.lang.String anchor)

prepareTag

java.lang.String prepareTag(java.lang.String tag)

analyzeScalar

static EmitterImpl.ScalarAnalysis analyzeScalar(org.jruby.util.ByteList scalar)

determineChomp

static java.lang.String determineChomp(org.jruby.util.ByteList text)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException