org.basex.io.serial
Class DOTSerializer

java.lang.Object
  extended by org.basex.io.serial.Serializer
      extended by org.basex.io.serial.OutputSerializer
          extended by org.basex.io.serial.DOTSerializer

public final class DOTSerializer
extends OutputSerializer

This class serializes data in the DOT syntax.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.io.serial.OutputSerializer
content, ct, docsys, escape, html5, indents, isep, nl, out, saomit, script, sep, tab
 
Fields inherited from class org.basex.io.serial.Serializer
elem, indent, level, PROPS, tags, undecl
 
Constructor Summary
DOTSerializer(java.io.OutputStream os, boolean c)
          Constructor, defining colors for the dot output.
 
Method Summary
protected  void atomic(Item it)
          Serializes an atomic value.
protected  void attribute(byte[] n, byte[] v)
          Serializes an attribute.
 void close()
          Closes the serializer.
protected  void finishClose()
          Closes an element.
protected  void finishComment(byte[] t)
          Serializes a comment.
protected  void finishEmpty()
          Closes an empty element.
protected  void finishOpen()
          Finishes an opening element node.
protected  void finishPi(byte[] n, byte[] v)
          Serializes a processing instruction.
protected  void finishText(byte[] t)
          Serializes a text.
protected  void startOpen(byte[] t)
          Starts an element.
 
Methods inherited from class org.basex.io.serial.OutputSerializer
closeResult, code, ct, doctype, finished, finishText, hex, indent, openDoc, openResult, print, print, print, printChar, reset
 
Methods inherited from class org.basex.io.serial.Serializer
closeDoc, closeElement, get, get, namespace, nsUri, serialize, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOTSerializer

public DOTSerializer(java.io.OutputStream os,
                     boolean c)
              throws java.io.IOException
Constructor, defining colors for the dot output.

Parameters:
os - output stream
c - compact representation
Throws:
java.io.IOException - I/O exception
Method Detail

close

public void close()
           throws java.io.IOException
Description copied from class: Serializer
Closes the serializer.

Overrides:
close in class OutputSerializer
Throws:
java.io.IOException - I/O exception

startOpen

protected void startOpen(byte[] t)
Description copied from class: Serializer
Starts an element.

Overrides:
startOpen in class OutputSerializer
Parameters:
t - tag name

attribute

protected void attribute(byte[] n,
                         byte[] v)
Description copied from class: Serializer
Serializes an attribute.

Overrides:
attribute in class OutputSerializer
Parameters:
n - name
v - value

finishOpen

protected void finishOpen()
                   throws java.io.IOException
Description copied from class: Serializer
Finishes an opening element node.

Overrides:
finishOpen in class OutputSerializer
Throws:
java.io.IOException - I/O exception

finishEmpty

protected void finishEmpty()
                    throws java.io.IOException
Description copied from class: Serializer
Closes an empty element.

Overrides:
finishEmpty in class OutputSerializer
Throws:
java.io.IOException - I/O exception

finishClose

protected void finishClose()
                    throws java.io.IOException
Description copied from class: Serializer
Closes an element.

Overrides:
finishClose in class OutputSerializer
Throws:
java.io.IOException - I/O exception

finishText

protected void finishText(byte[] t)
                   throws java.io.IOException
Description copied from class: Serializer
Serializes a text.

Overrides:
finishText in class OutputSerializer
Parameters:
t - value
Throws:
java.io.IOException - I/O exception

finishComment

protected void finishComment(byte[] t)
                      throws java.io.IOException
Description copied from class: Serializer
Serializes a comment.

Overrides:
finishComment in class OutputSerializer
Parameters:
t - value
Throws:
java.io.IOException - I/O exception

finishPi

protected void finishPi(byte[] n,
                        byte[] v)
                 throws java.io.IOException
Description copied from class: Serializer
Serializes a processing instruction.

Overrides:
finishPi in class OutputSerializer
Parameters:
n - name
v - value
Throws:
java.io.IOException - I/O exception

atomic

protected void atomic(Item it)
               throws java.io.IOException
Description copied from class: Serializer
Serializes an atomic value.

Overrides:
atomic in class OutputSerializer
Parameters:
it - item
Throws:
java.io.IOException - I/O exception