org.argouml.persistence
Class TodoParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.argouml.persistence.SAXParserBase
          extended byorg.argouml.persistence.TodoParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class TodoParser
extends SAXParserBase

Class that reads a todo list from a todo xml file.


Field Summary
private  String critic
          The critic String of the ResolvedCritic currently being read.
private  String description
          The description of the ToDoItem currently being read.
private  String headline
          The headline of the ToDoItem currently being read.
private static Logger LOG
           
private  String moreinfourl
          The moreInfoURL of the ToDoItem currently being read.
private  Vector offenders
          The offenders vector of the ResolvedCritic currently being read.
private  int priority
          The priority of the ToDoItem currently being read.
private  TodoTokenTable tokens
           
 
Fields inherited from class org.argouml.persistence.SAXParserBase
DBG
 
Constructor Summary
TodoParser()
          Creates a new TodoParser.
 
Method Summary
static String decode(String str)
          Utility method to decode a String filtering out any noise that an XML framework might have seen fit to add and thus regaining the original unmodified String.
static String encode(String str)
          Utility method to encode a String in a way that allows it to be saved properly in an XML file and regained filtering out any noice that an XML framework might have seen fit to add.
protected  void handleDescription(XMLElement e)
          Internal method.
 void handleEndElement(XMLElement e)
          Called by the XML implementation to signal the end of an XML entity.
protected  void handleHeadline(XMLElement e)
          Internal method.
protected  void handleIssueEnd(XMLElement e)
          Internal method.
protected  void handleIssueStart(XMLElement e)
          Internal method.
protected  void handleMoreInfoURL(XMLElement e)
          Internal method.
protected  void handleOffender(XMLElement e)
          Internal method.
protected  void handlePoster(XMLElement e)
          Internal method.
protected  void handlePriority(XMLElement e)
          Internal method.
protected  void handleResolvedCritics(XMLElement e)
          Internal method.
 void handleStartElement(XMLElement e)
          Called by the XML implementation to signal the start of an XML entity.
protected  void handleTodo(XMLElement e)
          Internal method.
protected  void handleTodoItemEnd(XMLElement e)
          Internal method.
protected  void handleTodoItemStart(XMLElement e)
          Internal method.
protected  void handleTodoList(XMLElement e)
          Internal method.
 void readTodoList(InputStream is)
          Reads an XML todo list from InputStream is and enters any todo items into the current designer.
 
Methods inherited from class org.argouml.persistence.SAXParserBase
characters, endElement, getJarResource, getParseTime, getStats, ignoreElement, isElementOfInterest, notImplemented, parse, resolveEntity, setStats, startElement
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

tokens

private TodoTokenTable tokens

headline

private String headline
The headline of the ToDoItem currently being read.


priority

private int priority
The priority of the ToDoItem currently being read.


moreinfourl

private String moreinfourl
The moreInfoURL of the ToDoItem currently being read.


description

private String description
The description of the ToDoItem currently being read.


critic

private String critic
The critic String of the ResolvedCritic currently being read.


offenders

private Vector offenders
The offenders vector of the ResolvedCritic currently being read.

Constructor Detail

TodoParser

public TodoParser()
Creates a new TodoParser.

Method Detail

readTodoList

public void readTodoList(InputStream is)
                  throws SAXException
Reads an XML todo list from InputStream is and enters any todo items into the current designer.

Parameters:
is - The stream containing TodoList XML data.
Throws:
SAXException - on any error

handleStartElement

public void handleStartElement(XMLElement e)
Called by the XML implementation to signal the start of an XML entity.

Specified by:
handleStartElement in class SAXParserBase
Parameters:
e - The entity being started.

handleEndElement

public void handleEndElement(XMLElement e)
                      throws SAXException
Called by the XML implementation to signal the end of an XML entity.

Specified by:
handleEndElement in class SAXParserBase
Parameters:
e - The XML entity that ends.
Throws:
SAXException - on any error

handleTodo

protected void handleTodo(XMLElement e)
Internal method.

Parameters:
e - the element

handleTodoList

protected void handleTodoList(XMLElement e)
Internal method.

Parameters:
e - the element

handleResolvedCritics

protected void handleResolvedCritics(XMLElement e)
Internal method.

Parameters:
e - the element

handleTodoItemStart

protected void handleTodoItemStart(XMLElement e)
Internal method.

Parameters:
e - the element

handleTodoItemEnd

protected void handleTodoItemEnd(XMLElement e)
Internal method.

Parameters:
e - the element

handleHeadline

protected void handleHeadline(XMLElement e)
Internal method.

Parameters:
e - the element

handlePriority

protected void handlePriority(XMLElement e)
Internal method.

Parameters:
e - the element

handleMoreInfoURL

protected void handleMoreInfoURL(XMLElement e)
Internal method.

Parameters:
e - the element

handleDescription

protected void handleDescription(XMLElement e)
Internal method.

Parameters:
e - the element

handleIssueStart

protected void handleIssueStart(XMLElement e)
Internal method.

Parameters:
e - the element

handleIssueEnd

protected void handleIssueEnd(XMLElement e)
Internal method.

Parameters:
e - the element

handlePoster

protected void handlePoster(XMLElement e)
Internal method.

Parameters:
e - the element

handleOffender

protected void handleOffender(XMLElement e)
Internal method.

Parameters:
e - the element

decode

public static String decode(String str)
Utility method to decode a String filtering out any noise that an XML framework might have seen fit to add and thus regaining the original unmodified String.

Parameters:
str - The String to decode.
Returns:
A copy of the original String.

encode

public static String encode(String str)
Utility method to encode a String in a way that allows it to be saved properly in an XML file and regained filtering out any noice that an XML framework might have seen fit to add.

Parameters:
str - The String to encode.
Returns:
The encoded String.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook