www.sdmetrics.com

com.sdmetrics.model
Class MetaModelElement

java.lang.Object
  extended by com.sdmetrics.model.MetaModelElement

public class MetaModelElement
extends java.lang.Object

Represents an element type of the SDMetrics metamodel.

An element type has a name, a parent element type, and a list of attributes. Attributes can contain data or references to model elements, and may be single-valued or multi-valued.


Method Summary
 java.lang.String getAttributeDescription(java.lang.String name)
          Gets the description of an attribute.
 java.util.Collection<java.lang.String> getAttributeNames()
          Gets the attribute names of the metamodel element.
 java.lang.String getExtensionReference()
          Gets the name of the extension reference attribute.
 java.lang.String getName()
          Gets the name of this element type.
 MetaModelElement getParent()
          Gets the parent of this element type.
 boolean hasAttribute(java.lang.String name)
          Tests if this element type has an attribute of a given name.
 boolean isRefAttribute(java.lang.String name)
          Tests if an attribute is a cross-reference attribute.
 boolean isSetAttribute(java.lang.String name)
          Tests if an attribute is multi-valued.
 boolean specializes(MetaModelElement base)
          Checks if this type specializes another type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Gets the name of this element type.

Returns:
Name of the element type.

getParent

public MetaModelElement getParent()
Gets the parent of this element type.

Returns:
Parent of the metamodel element, null if this is the metamodel base element type.
Since:
2.3

specializes

public boolean specializes(MetaModelElement base)
Checks if this type specializes another type.

Parameters:
base - Base type against which to check
Returns:
true if the base is the same type as this type, or a direct or indirect parent of this type.
Since:
2.3

getAttributeNames

public java.util.Collection<java.lang.String> getAttributeNames()
Gets the attribute names of the metamodel element. This includes inherited attributes. The collection maintains the attributes in the order in which they were defined in the metamodel definition file; inherited elements are listed first.

Returns:
Collection of attribute names

hasAttribute

public boolean hasAttribute(java.lang.String name)
Tests if this element type has an attribute of a given name.

Parameters:
name - Name of the candidate attribute
Returns:
true if this element type has an attribute of that name.

isRefAttribute

public boolean isRefAttribute(java.lang.String name)
Tests if an attribute is a cross-reference attribute.

Parameters:
name - Name of the attribute to test.
Returns:
true if the attribute is a cross-reference attribute, false if it is a data attribute.
Throws:
java.lang.IllegalArgumentException - Element type has no such attribute.

getExtensionReference

public java.lang.String getExtensionReference()
Gets the name of the extension reference attribute.

Returns:
Name of the extension reference attribute, or null if none is defined.
Since:
2.3

isSetAttribute

public boolean isSetAttribute(java.lang.String name)
Tests if an attribute is multi-valued.

Parameters:
name - Name of the attribute to test.
Returns:
true if the attribute is multi-valued, false if it only stores a single value.
Throws:
java.lang.IllegalArgumentException - Element type has no such attribute.

getAttributeDescription

public java.lang.String getAttributeDescription(java.lang.String name)
Gets the description of an attribute.

Parameters:
name - Name of the attribute.
Returns:
Informal description of the attribute.
Throws:
java.lang.IllegalArgumentException - Element type has no such attribute.

www.sdmetrics.com