|
|||||||||||
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()
Gets the last parsed element. |
Map |
getElementMap()
Gets the mapping of ids to elements. |
XMIElementAttributesReader |
getElementReader()
Gets the element attributes reader. |
XMIModelLinkReader |
getLinkReader()
Gets the element link reader for non-containment references. |
Model |
getModel()
Gets the model that is read. |
Namespace |
getNamespace()
Gets the last parsed namespace. |
Relationship |
getRelationship()
Gets the last parsed relationship. |
XMIElementTypeSwitch |
getTypeSwitch()
Gets the type switch for creating the right element. |
XMLReader |
getXmlParser()
Gets the XML parser. |
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,
String uri)
Prepares for read(). |
void |
processingInstruction(String target,
String data)
Processing instruction. |
Model |
read(InputStream input,
String uri,
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)
Sets the last parsed element. |
protected void |
setElementMap(Map elementMap)
Sets the mapping of ids to elements. |
protected void |
setElementReader(XMIElementAttributesReader elementReader)
Sets the element attributes reader. |
protected void |
setLinkReader(XMIModelLinkReader linkReader)
Sets the element link reader for non-containment references. |
protected void |
setModel(Model model)
Sets the model that is read. |
protected void |
setNamespace(Namespace namespace)
Sets the last parsed namespace. |
protected void |
setRelationship(Relationship relationship)
Sets the last parsed relationship. |
protected void |
setTypeSwitch(XMIElementTypeSwitch typeSwitch)
Sets the type switch for creating the right element. |
protected void |
setXmlParser(XMLReader xmlParser)
Sets the XML parser. |
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 |
startMultiplicity(Attributes attrs)
Parses a multiplicity tag |
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, String uri, ModelFactory factory) throws IOException, ModelElementException
read
in interface ModelReader
input
- the stream to read from.uri
- the uri of the model.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, String uri) throws Exception
factory
- the factory to create the model and the elements.uri
- the uri of the model.
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 startMultiplicity(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)
element
- the last parsed element.public ModelElement getElement()
protected void setElementMap(Map elementMap)
elementMap
- the mapping of ids to elements.public Map getElementMap()
protected void setElementReader(XMIElementAttributesReader elementReader)
elementReader
- the element attributes reader.public XMIElementAttributesReader getElementReader()
protected void setLinkReader(XMIModelLinkReader linkReader)
linkReader
- the element link reader for non-containment references.public XMIModelLinkReader getLinkReader()
protected void setModel(Model model)
model
- the model that is read.public Model getModel()
protected void setNamespace(Namespace namespace)
namespace
- the last parsed namespace.public Namespace getNamespace()
protected void setRelationship(Relationship relationship)
relationship
- the last parsed relationship.public Relationship getRelationship()
protected void setTypeSwitch(XMIElementTypeSwitch typeSwitch)
typeSwitch
- the type switch for creating the right element.public XMIElementTypeSwitch getTypeSwitch()
protected void setXmlParser(XMLReader xmlParser)
xmlParser
- the XML parser.public XMLReader getXmlParser()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |