|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
be.ac.vub.cocompose.io.xmi.XMIModelReader
Reads a CoCompose model from an XMI file (requires second pass by XMIModelLinkReader).
Constructor Summary | |
XMIModelReader()
|
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()
Finalises an ownedElement tag |
void |
endXMIElement(String local)
End XMI element. |
ModelElement |
getElement()
|
Hashtable |
getElementMap()
|
XMIElementAttributesReader |
getElementReader()
|
XMIModelLinkReader |
getLinkReader()
|
Model |
getModel()
|
Namespace |
getNamespace()
|
Relationship |
getRelationship()
|
XMIElementTypeSwitch |
getTypeSwitch()
|
XMLReader |
getXmlParser()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Ignorable whitespace. |
void |
notationDecl(String name,
String publicId,
String systemId)
DTD declaration. |
protected void |
preRead(ModelFactory factory)
Prepares for read(). |
void |
processingInstruction(String target,
String data)
Processing instruction. |
Model |
read(InputStream input,
ModelFactory factory)
Reads the model from its uri. |
Model |
read(String uri,
ModelFactory factory)
Reads the model from its uri. |
protected void |
setElement(ModelElement element)
|
protected void |
setElementMap(Hashtable elementMap)
|
protected void |
setElementReader(XMIElementAttributesReader elementReader)
|
protected void |
setLinkReader(XMIModelLinkReader linkReader)
|
protected void |
setModel(Model model)
|
protected void |
setNamespace(Namespace namespace)
|
protected void |
setRelationship(Relationship relationship)
|
protected void |
setTypeSwitch(XMIElementTypeSwitch typeSwitch)
|
protected void |
setXmlParser(XMLReader xmlParser)
|
void |
startCoComposeElement(String local,
Attributes attrs)
Start CoCompose element. |
void |
startColor(Attributes attrs)
Parses a color tag |
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 |
startPosition(Attributes attrs)
Parses a position 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 |
public XMIModelReader()
Method Detail |
public Model read(String uri, ModelFactory factory) throws IOException, ModelElementException
read
in interface ModelReader
uri
- - the uri to read from.factory
- - the model factory used to create the elements.
IOException
- - if the model could not be read.
ModelElementException
- - if a model element could not be read.public Model read(InputStream input, ModelFactory factory) throws IOException, ModelElementException
read
in interface ModelReader
input
- - the stream to read from.factory
- - the model factory used to create the elements.
IOException
- - if the model could not be read.
ModelElementException
- - if a model element could not be read.protected void preRead(ModelFactory factory) throws Exception
factory
- - the factory to create the model and the elements.
Exception
- if pre-read setup failed.public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
target
- Processing instruction element name.data
- Processing instruction element data.
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void startElement(String uri, String local, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
uri
- XML namespace URI.local
- local element name.raw
- raw (qualified) element name.attrs
- element attributes.
SAXException
public void startXMIElement(String local, Attributes attrs) throws SAXException
local
- local element name.attrs
- element attributes.
SAXException
public void startCoComposeElement(String local, Attributes attrs) throws SAXException
local
- local element name.attrs
- element attributes.
SAXException
public void startOwnedElement(Attributes attrs) throws ModelElementException
attrs
- element attributes
ModelElementException
public void endOwnedElement() throws ModelElementException
ModelElementException
public void startPosition(Attributes attrs) throws ModelElementException
attrs
- element attributes
ModelElementException
public void startColor(Attributes attrs) throws ModelElementException
attrs
- element attributes
ModelElementException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
ch
- Characters to print.start
- Starting index of characters.length
- Length of characters.
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ch
- Characters to print.start
- Starting index of characters.length
- Length of characters.
SAXException
public void endElement(String uri, String local, String raw) throws SAXException
endElement
in interface ContentHandler
uri
- Ignored.local
- Ignored.raw
- Element name.
SAXException
public void endXMIElement(String local) throws SAXException
local
- local element name.
SAXException
public void endCoComposeElement(String local) throws SAXException
local
- local element name.
SAXException
public void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl
in interface DTDHandler
name
- DTD name.publicId
- DTD public ID.systemId
- DTD system ID.
SAXException
protected void setElement(ModelElement element)
public ModelElement getElement()
protected void setElementMap(Hashtable elementMap)
public Hashtable getElementMap()
protected void setElementReader(XMIElementAttributesReader elementReader)
public XMIElementAttributesReader getElementReader()
protected void setLinkReader(XMIModelLinkReader linkReader)
public XMIModelLinkReader getLinkReader()
protected void setModel(Model model)
public Model getModel()
protected void setNamespace(Namespace namespace)
public Namespace getNamespace()
protected void setRelationship(Relationship relationship)
public Relationship getRelationship()
protected void setTypeSwitch(XMIElementTypeSwitch typeSwitch)
public XMIElementTypeSwitch getTypeSwitch()
protected void setXmlParser(XMLReader xmlParser)
public XMLReader getXmlParser()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |