org.basex.data
Class SAXSerializer

java.lang.Object
  extended by org.basex.data.Serializer
      extended by org.basex.data.SAXSerializer
All Implemented Interfaces:
XMLReader

public final class SAXSerializer
extends Serializer
implements XMLReader

This class allows to output XML results via SAX.

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

Field Summary
 
Fields inherited from class org.basex.data.Serializer
dn, ns
 
Constructor Summary
SAXSerializer(Result res)
          Constructor.
 
Method Summary
 void attribute(byte[] n, byte[] v)
          Serializes an attribute.
 void closeResult()
          Closes a result.
 void comment(byte[] t)
          Serializes a comment.
 ContentHandler getContentHandler()
           
 DTDHandler getDTDHandler()
           
 EntityResolver getEntityResolver()
           
 ErrorHandler getErrorHandler()
           
 boolean getFeature(String name)
           
 Object getProperty(String name)
           
 void item(byte[] b)
          Serializes an item.
 void openResult()
          Starts a result.
 void parse(InputSource input)
           
 void parse(String id)
           
 void pi(byte[] n, byte[] v)
          Serializes a processing instruction.
 void setContentHandler(ContentHandler c)
           
 void setDTDHandler(DTDHandler h)
           
 void setEntityResolver(EntityResolver resolver)
           
 void setErrorHandler(ErrorHandler h)
           
 void setFeature(String name, boolean value)
           
 void setLexicalHandler(LexicalHandler l)
          Sets the lexical handler for reacting on comments.
 void setProperty(String name, Object value)
           
 void text(byte[] b)
          Serializes a text.
 void text(byte[] b, FTPos ftp)
          Serializes a text.
 
Methods inherited from class org.basex.data.Serializer
close, closeElement, emptyElement, emptyElement, finished, level, namespace, node, node, openElement, openElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXSerializer

public SAXSerializer(Result res)
Constructor.

Parameters:
res - result
Method Detail

getContentHandler

public ContentHandler getContentHandler()
Specified by:
getContentHandler in interface XMLReader

getDTDHandler

public DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface XMLReader

getEntityResolver

public EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface XMLReader

getErrorHandler

public ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface XMLReader

getFeature

public boolean getFeature(String name)
Specified by:
getFeature in interface XMLReader

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface XMLReader

parse

public void parse(InputSource input)
           throws SAXException
Specified by:
parse in interface XMLReader
Throws:
SAXException

parse

public void parse(String id)
           throws SAXException
Specified by:
parse in interface XMLReader
Throws:
SAXException

setContentHandler

public void setContentHandler(ContentHandler c)
Specified by:
setContentHandler in interface XMLReader

setLexicalHandler

public void setLexicalHandler(LexicalHandler l)
Sets the lexical handler for reacting on comments.

Parameters:
l - handler

setDTDHandler

public void setDTDHandler(DTDHandler h)
Specified by:
setDTDHandler in interface XMLReader

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Specified by:
setEntityResolver in interface XMLReader

setErrorHandler

public void setErrorHandler(ErrorHandler h)
Specified by:
setErrorHandler in interface XMLReader

setFeature

public void setFeature(String name,
                       boolean value)
Specified by:
setFeature in interface XMLReader

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface XMLReader

openResult

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

Specified by:
openResult in class Serializer
Throws:
IOException - I/O exception

closeResult

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

Specified by:
closeResult in class Serializer
Throws:
IOException - I/O exception

attribute

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

Specified by:
attribute in class Serializer
Parameters:
n - name
v - value

text

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

Specified by:
text in class Serializer
Parameters:
b - text bytes
Throws:
IOException - I/O exception

text

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

Specified by:
text in class Serializer
Parameters:
b - text bytes
ftp - full-text positions
Throws:
IOException - I/O exception

comment

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

Specified by:
comment in class Serializer
Parameters:
t - comment
Throws:
IOException - I/O exception

pi

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

Specified by:
pi in class Serializer
Parameters:
n - name
v - value
Throws:
IOException - I/O exception

item

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

Specified by:
item in class Serializer
Parameters:
b - text bytes
Throws:
IOException - I/O exception