org.basex.io.serial
Class BuilderSerializer

java.lang.Object
  extended by org.basex.io.serial.Serializer
      extended by org.basex.io.serial.BuilderSerializer

public class BuilderSerializer
extends Serializer

A serializer that pipes the events directly through to a builder.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

Field Summary
 
Fields inherited from class org.basex.io.serial.Serializer
elem, indent, level, PROPS, tags, undecl
 
Constructor Summary
BuilderSerializer(Builder b)
          Constructor taking a Builder.
 
Method Summary
protected  void atomic(Item b)
          Serializes an atomic value.
protected  void attribute(byte[] n, byte[] v)
          Serializes an attribute.
protected  void closeDoc()
          Closes a document.
protected  void finishClose()
          Closes an element.
protected  void finishComment(byte[] b)
          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[] b)
          Serializes a text.
protected  void openDoc(byte[] name)
          Opens a document.
protected  void startOpen(byte[] t)
          Starts an element.
 
Methods inherited from class org.basex.io.serial.Serializer
close, closeElement, closeResult, finished, finishText, get, get, namespace, nsUri, openResult, reset, serialize, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderSerializer

public BuilderSerializer(Builder b)
Constructor taking a Builder.

Parameters:
b - builder to be used
Method Detail

finishText

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

Specified by:
finishText in class Serializer
Parameters:
b - value
Throws:
java.io.IOException - I/O exception

startOpen

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

Specified by:
startOpen in class Serializer
Parameters:
t - tag name
Throws:
java.io.IOException - I/O exception

finishPi

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

Specified by:
finishPi in class Serializer
Parameters:
n - name
v - value
Throws:
java.io.IOException - I/O exception

atomic

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

Specified by:
atomic in class Serializer
Parameters:
b - item
Throws:
java.io.IOException - I/O exception

finishOpen

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

Specified by:
finishOpen in class Serializer
Throws:
java.io.IOException - I/O exception

finishEmpty

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

Specified by:
finishEmpty in class Serializer
Throws:
java.io.IOException - I/O exception

finishClose

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

Specified by:
finishClose in class Serializer
Throws:
java.io.IOException - I/O exception

finishComment

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

Specified by:
finishComment in class Serializer
Parameters:
b - value
Throws:
java.io.IOException - I/O exception

attribute

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

Specified by:
attribute in class Serializer
Parameters:
n - name
v - value
Throws:
java.io.IOException - I/O exception

openDoc

protected void openDoc(byte[] name)
                throws java.io.IOException
Description copied from class: Serializer
Opens a document.

Overrides:
openDoc in class Serializer
Parameters:
name - name
Throws:
java.io.IOException - I/O exception

closeDoc

protected final void closeDoc()
                       throws java.io.IOException
Description copied from class: Serializer
Closes a document.

Overrides:
closeDoc in class Serializer
Throws:
java.io.IOException - I/O exception