be.ac.vub.cocompose.io.xmi
Class XMIModelLinkReader

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bybe.ac.vub.cocompose.io.xmi.XMIModelLinkReader
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMIModelLinkReader
extends DefaultHandler

Reads the links in a CoCompose model from an XMI file (requires first pass by XMIModelReader).

Since:
0.2.0
Version:
0.2.3, 20/01/2004
Author:
Dennis Wagelaar

Constructor Summary
XMIModelLinkReader(Model model, Hashtable elementMap)
          Creates an XMIModelLinkReader
 
Method Summary
 void characters(char[] ch, int start, int length)
          Characters.
 void endCoComposeElement(String local)
          Start CoCompose element.
 void endElement(String uri, String local, String raw)
          End element.
 void endOwnedElement()
          Parses an ownedElement tag
 void endXMIElement(String local)
          End XMI element.
 void ignorableWhitespace(char[] ch, int start, int length)
          Ignorable whitespace.
 void notationDecl(String name, String publicId, String systemId)
          DTD declaration.
 void processingInstruction(String target, String data)
          Processing instruction.
 void startCoComposeElement(String local, Attributes attrs)
          Start CoCompose element.
 void startDocument()
          Start document.
 void startElement(String uri, String local, String raw, Attributes attrs)
          Start element.
 void startOwnedElement(Attributes attrs)
          Parses an ownedElement tag
 void startPart(Attributes attrs)
          Parses a part tag
 void startParticipant(Attributes attrs)
          Parses a participant tag
 void startPartOf(Attributes attrs)
          Parses a partOf tag
 void startXMIElement(String local, Attributes attrs)
          Start XMI element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMIModelLinkReader

public XMIModelLinkReader(Model model,
                          Hashtable elementMap)
                   throws ModelElementException
Creates an XMIModelLinkReader

Parameters:
model - the model after one pass by XMIModelReader
elementMap - the map of id -> element
Method Detail

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Processing instruction.

Parameters:
target - Processing instruction element name.
data - Processing instruction element data.
Throws:
SAXException

startDocument

public void startDocument()
                   throws SAXException
Start document.

Throws:
SAXException

startElement

public void startElement(String uri,
                         String local,
                         String raw,
                         Attributes attrs)
                  throws SAXException
Start element.

Parameters:
uri - XML namespace URI.
local - local element name.
raw - raw (qualified) element name.
attrs - element attributes.
Throws:
SAXException

startXMIElement

public void startXMIElement(String local,
                            Attributes attrs)
                     throws SAXException
Start XMI element.

Parameters:
local - local element name.
attrs - element attributes.
Throws:
SAXException

startCoComposeElement

public void startCoComposeElement(String local,
                                  Attributes attrs)
                           throws SAXException
Start CoCompose element.

Parameters:
local - local element name.
attrs - element attributes.
Throws:
SAXException

startOwnedElement

public void startOwnedElement(Attributes attrs)
                       throws ModelElementException
Parses an ownedElement tag

Parameters:
attrs - element attributes
Throws:
ModelElementException

startParticipant

public void startParticipant(Attributes attrs)
                      throws ModelElementException
Parses a participant tag

Parameters:
attrs - element attributes
Throws:
ModelElementException

startPartOf

public void startPartOf(Attributes attrs)
                 throws ModelElementException
Parses a partOf tag

Parameters:
attrs - element attributes
Throws:
ModelElementException

startPart

public void startPart(Attributes attrs)
               throws ModelElementException
Parses a part tag

Parameters:
attrs - element attributes
Throws:
ModelElementException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Characters.

Parameters:
ch - Characters to print.
start - Starting index of characters.
length - Length of characters.
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Ignorable whitespace.

Parameters:
ch - Characters to print.
start - Starting index of characters.
length - Length of characters.
Throws:
SAXException

endElement

public void endElement(String uri,
                       String local,
                       String raw)
                throws SAXException
End element.

Parameters:
uri - Ignored.
local - Ignored.
raw - Element name.
Throws:
SAXException

endXMIElement

public void endXMIElement(String local)
                   throws SAXException
End XMI element.

Parameters:
local - local element name.
Throws:
SAXException

endCoComposeElement

public void endCoComposeElement(String local)
                         throws SAXException
Start CoCompose element.

Parameters:
local - local element name.
Throws:
SAXException

endOwnedElement

public void endOwnedElement()
                     throws ModelElementException
Parses an ownedElement tag

Throws:
ModelElementException

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
                  throws SAXException
DTD declaration.

Parameters:
name - DTD name.
publicId - DTD public ID.
systemId - DTD system ID.
Throws:
SAXException