no.ubicollab.osgi
Class ClientRequestParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by no.ubicollab.osgi.ClientRequestParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ClientRequestParser
extends org.xml.sax.helpers.DefaultHandler

The Class ClientRequestParser implements a SAX DefaultHandler which is costomized to parse a xml-document with client requests.

Since:
0.1
Version:
0.6
Author:
Kim-Steve Johansen

Constructor Summary
ClientRequestParser()
          This Constructor creates a new ClientRequestParser with a stack and an empty client request list.
 
Method Summary
 void characters(char[] data, int start, int length)
          Inherited, but not needed since the ClientRequestList xml structure stores data purely in attributes.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Called by the sax-documentreader when a endElement event occurs.
 java.util.ArrayList<ClientRequest> getClientRequestList()
          Gets the parsed client request list.
 void setDocumentLocator(org.xml.sax.Locator rhs)
          Inherited, but not used in this implementation.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attribs)
          Invoked by the sax-documentreader when a startElement event occurs.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientRequestParser

public ClientRequestParser()
This Constructor creates a new ClientRequestParser with a stack and an empty client request list. The parser is immediately ready to handle parse events.

Method Detail

getClientRequestList

public java.util.ArrayList<ClientRequest> getClientRequestList()
Gets the parsed client request list. Must only be called after the parsing has been performed.

Returns:
A typed ArrayList containing ClientRequest objects, or a empty list if none found.

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator rhs)
Inherited, but not used in this implementation. The application can use the Locator object to obtain the location of any other SAX event in the XML source document.

See DefaultHandler#setDocumentLocator for details.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
See Also:
DefaultHandler.setDocumentLocator(org.xml.sax.Locator)

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attribs)
Invoked by the sax-documentreader when a startElement event occurs.

Parameters are described in DefaultHandler#startElement

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
See Also:
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
Called by the sax-documentreader when a endElement event occurs.

Parameters are described in DefaultHandler#endElement

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
See Also:
DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] data,
                       int start,
                       int length)
Inherited, but not needed since the ClientRequestList xml structure stores data purely in attributes. The purpose of this member is to read element xml-values onto the stack.

See DefaultHandler#characters for more details.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
See Also:
DefaultHandler.characters(char[], int, int)