|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--sdmetrics.model.MetaModel
Class to read the SDMetrics UML metamodel from the metamodel definition file, and store the model for retrieval.
The class manages a set of metamodel elements, and provides access to them. Each metamodel element has a name, an ID, and a list of attributes.
| Field Summary | |
static java.lang.String |
CONTEXT
The name of the attribute that stores the owner of the model element. |
static java.lang.String |
TL_ELEMENT
The name of the top level XML element in the metamodel definition file. |
| Constructor Summary | |
MetaModel()
|
|
| Method Summary | |
void |
characters(char[] ch,
int start,
int length)
SAX parser handler for XML PCDATA in metamodel definition file. |
void |
endDocument()
SAX parser handler: at the end of the document, calculate the set of inherited attributes of each metamodel element. |
int |
getAttributeCount(int id)
Retrieve the number of attributes for a metamodel element. |
java.lang.String |
getAttributeDescription(int id,
int num)
Retrieve the description of an attribute for a metamodel element. |
int |
getAttributeIndex(int id,
java.lang.String s)
Find the index of an attributes for a metamodel element. |
java.lang.String |
getAttributeName(int id,
int num)
Retrieve the name of an attribute for a metamodel element. |
int |
getNumberOfTypes()
Retrieve the number of elements in the metamodel. |
int |
getTypeId(java.lang.String type)
Retrieve the ID of a metamodel element from its name. |
java.lang.String |
getTypeName(int id)
Retrieve the name of a metamodel element from its ID. |
boolean |
isRefAttribute(int id,
int num)
Test if an attribute of a metamodel element is a cross-reference attribute. |
boolean |
isSetAttribute(int id,
int num)
Test if an attribute of a metamodel element is multi-valued. |
void |
startDocument()
SAX parser handler: empty the metamodel at the beginning of the XML document. |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
SAX parser handler to read an XML element in the metamodel definition file. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String TL_ELEMENT
public static final java.lang.String CONTEXT
| Constructor Detail |
public MetaModel()
| Method Detail |
public void startDocument()
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException - The XML file contains something other than model
element and attribute definitions.
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerpublic void endDocument()
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerpublic int getTypeId(java.lang.String type)
type - The name of the metamodel element.
public int getNumberOfTypes()
public java.lang.String getTypeName(int id)
id - The ID of the metamodel element.
public int getAttributeCount(int id)
id - The ID of the metamodel element.
public java.lang.String getAttributeName(int id,
int num)
id - The ID of the metamodel element.num - The index of the attribute.
public java.lang.String getAttributeDescription(int id,
int num)
id - The ID of the metamodel element.num - The index of the attribute.
public boolean isRefAttribute(int id,
int num)
id - The id of the metamodel element.num - The index of the attribute.
true if the attribute is a cross-reference attribute,
false if it is a data attribute.
public boolean isSetAttribute(int id,
int num)
id - The id of the metamodel element.num - The index of the attribute.
true if the attribute is multi-valued, else false.
public int getAttributeIndex(int id,
java.lang.String s)
id - The ID of the metamodel element.s - The name of the attribute.
|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||