org.basex.data
Class XMLSerializer

java.lang.Object
  extended by org.basex.data.Serializer
      extended by org.basex.data.XMLSerializer

public final class XMLSerializer
extends Serializer

This is an interface for serializing XML results.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Field Summary
static java.lang.String INDENT
          Indentation.
 PrintOutput out
          Output stream.
 
Fields inherited from class org.basex.data.Serializer
dn, ns, tags
 
Constructor Summary
XMLSerializer(PrintOutput o)
          Constructor.
XMLSerializer(PrintOutput o, boolean x, boolean p)
          Constructor.
 
Method Summary
 void attribute(byte[] n, byte[] v)
          Serializes an attribute.
 void close()
          Finishes the serializer.
 void closeResult()
          Closes a result.
 void comment(byte[] n)
          Serializes a comment.
 boolean finished()
          Tests if the serialization was interrupted.
 void item(byte[] b)
          Serializes an item.
 void openResult()
          Starts a result.
 void pi(byte[] n, byte[] v)
          Serializes a processing instruction.
 void text(byte[] b)
          Serializes a text.
 void text(byte[] b, int[][] ftd, TokenList ial)
          Serializes a text.
 
Methods inherited from class org.basex.data.Serializer
closeElement, emptyElement, namespace, node, node, openElement, openElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT

public static final java.lang.String INDENT
Indentation.

See Also:
Constant Field Values

out

public final PrintOutput out
Output stream.

Constructor Detail

XMLSerializer

public XMLSerializer(PrintOutput o)
              throws java.io.IOException
Constructor.

Parameters:
o - output stream
Throws:
java.io.IOException - exception

XMLSerializer

public XMLSerializer(PrintOutput o,
                     boolean x,
                     boolean p)
              throws java.io.IOException
Constructor.

Parameters:
o - output stream
x - xml output
p - pretty printing
Throws:
java.io.IOException - exception
Method Detail

close

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

Specified by:
close in class Serializer
Throws:
java.io.IOException - exception

openResult

public void openResult()
                throws java.io.IOException
Description copied from class: Serializer
Starts a result.

Specified by:
openResult in class Serializer
Throws:
java.io.IOException - exception

closeResult

public void closeResult()
                 throws java.io.IOException
Description copied from class: Serializer
Closes a result.

Specified by:
closeResult in class Serializer
Throws:
java.io.IOException - exception

attribute

public 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 - exception

text

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

Specified by:
text in class Serializer
Parameters:
b - text bytes
Throws:
java.io.IOException - exception

text

public void text(byte[] b,
                 int[][] ftd,
                 TokenList ial)
          throws java.io.IOException
Description copied from class: Serializer
Serializes a text.

Specified by:
text in class Serializer
Parameters:
b - text bytes
ftd - fulltext positions
ial - fulltext ftand colorinfo
Throws:
java.io.IOException - exception

comment

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

Specified by:
comment in class Serializer
Parameters:
n - comment
Throws:
java.io.IOException - exception

pi

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

Specified by:
pi in class Serializer
Parameters:
n - name
v - value
Throws:
java.io.IOException - exception

item

public void item(byte[] b)
          throws java.io.IOException
Description copied from class: Serializer
Serializes an item.

Specified by:
item in class Serializer
Parameters:
b - text bytes
Throws:
java.io.IOException - exception

finished

public boolean finished()
Description copied from class: Serializer
Tests if the serialization was interrupted.

Overrides:
finished in class Serializer
Returns:
result of check