net.sf.joost.emitter
Class BufferEmitter

java.lang.Object
  extended by net.sf.joost.emitter.StxEmitterBase
      extended by net.sf.joost.emitter.BufferEmitter
All Implemented Interfaces:
Constants, StxEmitter, ContentHandler, LexicalHandler

public class BufferEmitter
extends StxEmitterBase

This class implements a buffer for storing SAX events.

Version:
$Revision: 1.5 $ $Date: 2005/11/06 21:22:21 $
Author:
Oliver Becker

Field Summary
private  Vector buffer
          the event buffer
private  boolean charsEmitted
          characters flag, needed for detecting empty CDATA sections
private  SAXEvent[] eventArray
          the event array, the old contents remains valid until this buffer is completely new filled
private  boolean insideCDATA
          CDATA flag
 
Fields inherited from interface net.sf.joost.Constants
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS
 
Constructor Summary
BufferEmitter()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void clear()
          Clears the event buffer
 void comment(char[] ch, int start, int length)
           
 void endCDATA()
           
 void endDocument()
          do nothing
 void endDTD()
          not used
 void endElement(String namespaceURI, String localName, String qName)
           
 void endEntity(String name)
          not used
 void endPrefixMapping(String prefix)
           
 void filled()
          Signals that the buffer is completely filled; makes its contents available to getEvents()
 SAXEvent[] getEvents()
           
 void ignorableWhitespace(char[] ch, int start, int length)
          not used
 void processingInstruction(String target, String data)
           
 void setDocumentLocator(Locator locator)
          not used
 void skippedEntity(String name)
          not used
 void startCDATA()
           
 void startDocument()
          do nothing
 void startDTD(String name, String publicId, String systemId)
          not used
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
           
 void startEntity(String name)
          not used
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class net.sf.joost.emitter.StxEmitterBase
getSystemId, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

private Vector buffer
the event buffer


eventArray

private SAXEvent[] eventArray
the event array, the old contents remains valid until this buffer is completely new filled


insideCDATA

private boolean insideCDATA
CDATA flag


charsEmitted

private boolean charsEmitted
characters flag, needed for detecting empty CDATA sections

Constructor Detail

BufferEmitter

public BufferEmitter()
Method Detail

getEvents

public SAXEvent[] getEvents()
Returns:
an array of the events stored in this buffer

clear

public void clear()
Clears the event buffer


filled

public void filled()
Signals that the buffer is completely filled; makes its contents available to getEvents()


setDocumentLocator

public void setDocumentLocator(Locator locator)
not used


startDocument

public void startDocument()
                   throws SAXException
do nothing

Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
do nothing

Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
not used

Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Throws:
SAXException

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
not used

Throws:
SAXException

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
              throws SAXException
not used

Throws:
SAXException

endDTD

public void endDTD()
            throws SAXException
not used

Throws:
SAXException

startEntity

public void startEntity(String name)
                 throws SAXException
not used

Throws:
SAXException

endEntity

public void endEntity(String name)
               throws SAXException
not used

Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Throws:
SAXException