www.sdmetrics.com

com.sdmetrics.model
Class MetaModel

java.lang.Object
  extended by com.sdmetrics.model.MetaModel
All Implemented Interfaces:
java.lang.Iterable<MetaModelElement>

public class MetaModel
extends java.lang.Object
implements java.lang.Iterable<MetaModelElement>

Represents an SDMetrics metamodel. The metamodel defines the available model element types and their attributes.

The class parses the metamodel definition file, manages the set of MetaModelElement instances that constitute the metamodel, and provides access to them.


Field Summary
static java.lang.String BASE_ELEMENT
          The name of the base element type.
static java.lang.String TL_ELEMENT
          The name of the top level XML element in the metamodel definition file.
 
Constructor Summary
MetaModel()
           
 
Method Summary
 org.xml.sax.helpers.DefaultHandler getSAXParserHandler()
          Gets a SAX handler to populate this metamodel with the contents of a metamodel definition file.
 MetaModelElement getType(java.lang.String typeName)
          Retrieves a metamodel element by its type name.
 java.util.Iterator<MetaModelElement> iterator()
          Retrieves an iterator over the element types in this metamodel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TL_ELEMENT

public static final java.lang.String TL_ELEMENT
The name of the top level XML element in the metamodel definition file.

See Also:
Constant Field Values

BASE_ELEMENT

public static final java.lang.String BASE_ELEMENT
The name of the base element type.

See Also:
Constant Field Values
Constructor Detail

MetaModel

public MetaModel()
Method Detail

iterator

public java.util.Iterator<MetaModelElement> iterator()
Retrieves an iterator over the element types in this metamodel. Types are returned in the order in which they were added/defined in the metamodel definition file.

Specified by:
iterator in interface java.lang.Iterable<MetaModelElement>
Returns:
Metamodel element iterator

getSAXParserHandler

public org.xml.sax.helpers.DefaultHandler getSAXParserHandler()
Gets a SAX handler to populate this metamodel with the contents of a metamodel definition file.

Returns:
SAX handler to parse the metamodel definition file

getType

public MetaModelElement getType(java.lang.String typeName)
Retrieves a metamodel element by its type name.

Parameters:
typeName - The type name of the metamodel element.
Returns:
The metamodel element with that name or null if there is no element of that name.

www.sdmetrics.com