de.knup.jedi.jayshare.sax
Class QueueHandler

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--de.knup.jedi.jayshare.sax.QueueHandler

public class QueueHandler
extends HandlerBase

Handles download queue XML parsing.

Version:
0.1 $Revision: 1.5 $
Author:
B. Pietsch

Field Summary
private  QueueItem currentHash
          Current hash item to be parsed.
private  FilehashItem currentItem
          Current file item to be parsed.
private  java.lang.StringBuffer elementChars
          Data buffer.
private  DownloadQueue queue
          Download Queue representation will finally contain the queue.
 
Constructor Summary
QueueHandler()
          Create the QueueHandler.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Buffer incoming data.
 void endElement(java.lang.String name)
          Receive notification of the end of an element.
 DownloadQueue getQueue()
           
 void ignorableWhitespace(char[] ch, int start, int length)
          Ignore ignorable whitespaces.
 void startElement(java.lang.String name, AttributeList attributes)
          Receive notification of the start of an element.
 
Methods inherited from class org.xml.sax.HandlerBase
endDocument, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

queue

private DownloadQueue queue
Download Queue representation will finally contain the queue.

currentHash

private QueueItem currentHash
Current hash item to be parsed.

currentItem

private FilehashItem currentItem
Current file item to be parsed.

elementChars

private java.lang.StringBuffer elementChars
Data buffer.
Constructor Detail

QueueHandler

public QueueHandler()
Create the QueueHandler.
Method Detail

getQueue

public DownloadQueue getQueue()
Returns:
the parsed DownloadQueue.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Buffer incoming data.
Overrides:
characters in class HandlerBase
Tags copied from class: HandlerBase
Parameters:
ch - The characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Ignore ignorable whitespaces. I guess that's what we should do with em.
Overrides:
ignorableWhitespace in class HandlerBase
Tags copied from class: HandlerBase
Parameters:
ch - The whitespace characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.ignorableWhitespace(char[], int, int)

startElement

public void startElement(java.lang.String name,
                         AttributeList attributes)
                  throws SAXException
Description copied from class: HandlerBase
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Overrides:
startElement in class HandlerBase
Tags copied from class: HandlerBase
Parameters:
name - The element type name.
attributes - The specified or defaulted attributes.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)

endElement

public void endElement(java.lang.String name)
                throws SAXException
Description copied from class: HandlerBase
Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Overrides:
endElement in class HandlerBase
Tags copied from class: HandlerBase
Parameters:
name - The element type name.
attributes - The specified or defaulted attributes.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.endElement(java.lang.String)