org.argouml.persistence
Class ArgoParser

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

public class ArgoParser
extends SAXParserBase


Field Summary
private static Logger LOG
          Logger.
private  ArrayList memberList
           
private  Project project
           
private  ArgoTokenTable tokens
           
private  URL url
           
 
Fields inherited from class org.argouml.persistence.SAXParserBase
DBG
 
Constructor Summary
ArgoParser()
          The constructor.
 
Method Summary
 List getMemberList()
          Get the numer of diagram members read.
 Project getProject()
          Get the project to which the URL is to be parsed.
protected  void handleArgo(XMLElement e)
           
protected  void handleAuthorname(XMLElement e)
           
protected  void handleDescription(XMLElement e)
           
protected  void handleDocumentation(XMLElement e)
           
 void handleEndElement(XMLElement e)
          Implement in the concrete class to handle reaching the end tag of an element of interest.
protected  void handleHistoryfile(XMLElement e)
           
protected  void handleMember(XMLElement e)
           
protected  void handleSearchpath(XMLElement e)
           
 void handleStartElement(XMLElement e)
          Implement in the concrete class to handle reaching the start tag of an element of interest.
protected  void handleVersion(XMLElement e)
           
protected  boolean isElementOfInterest(String name)
          Determine if an element of the given name is of interest to the parser.
 void readProject(Project theProject, InputStream is)
           
 void setProject(Project newProj)
          Set the project to which the URL is to be parsed.
 
Methods inherited from class org.argouml.persistence.SAXParserBase
characters, endElement, getJarResource, getParseTime, getStats, ignoreElement, 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
Logger.


project

private Project project

tokens

private ArgoTokenTable tokens

url

private URL url

memberList

private ArrayList memberList
Constructor Detail

ArgoParser

public ArgoParser()
The constructor.

Method Detail

readProject

public void readProject(Project theProject,
                        InputStream is)
                 throws SAXException
Parameters:
theProject - the project to populate
is - the inputStream
Throws:
SAXException - on error when parsing xml

getProject

public Project getProject()
Get the project to which the URL is to be parsed.

Returns:
the project

setProject

public void setProject(Project newProj)
Set the project to which the URL is to be parsed.

Parameters:
newProj - the project

handleStartElement

public void handleStartElement(XMLElement e)
                        throws SAXException
Description copied from class: SAXParserBase
Implement in the concrete class to handle reaching the start tag of an element of interest.

Specified by:
handleStartElement in class SAXParserBase
Parameters:
e - the element.
Throws:
SAXException - on any error parsing the element.
See Also:
SAXParserBase.handleStartElement( org.argouml.persistence.XMLElement)

handleEndElement

public void handleEndElement(XMLElement e)
                      throws SAXException
Description copied from class: SAXParserBase
Implement in the concrete class to handle reaching the end tag of an element of interest.

Specified by:
handleEndElement in class SAXParserBase
Parameters:
e - the element.
Throws:
SAXException - on any error parsing the element.
See Also:
SAXParserBase.handleEndElement( org.argouml.persistence.XMLElement)

isElementOfInterest

protected boolean isElementOfInterest(String name)
Description copied from class: SAXParserBase
Determine if an element of the given name is of interest to the parser. The base implementation assumes always true.

Overrides:
isElementOfInterest in class SAXParserBase
Parameters:
name - the element name.
Returns:
true if the element name is of interest.
See Also:
SAXParserBase.isElementOfInterest(String)

handleArgo

protected void handleArgo(XMLElement e)
Parameters:
e - the element

handleDocumentation

protected void handleDocumentation(XMLElement e)
Parameters:
e - the element

handleAuthorname

protected void handleAuthorname(XMLElement e)
Parameters:
e - the element

handleVersion

protected void handleVersion(XMLElement e)
Parameters:
e - the element

handleDescription

protected void handleDescription(XMLElement e)
Parameters:
e - the element

handleSearchpath

protected void handleSearchpath(XMLElement e)
Parameters:
e - the element

handleMember

protected void handleMember(XMLElement e)
                     throws SAXException
Parameters:
e - the element
Throws:
SAXException - on any error parsing the member XML.

handleHistoryfile

protected void handleHistoryfile(XMLElement e)
Parameters:
e - the element

getMemberList

public List getMemberList()
Get the numer of diagram members read.

Returns:
the numer of diagram members read.


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