public class ModelElement
extends java.lang.Object
Constructor and Description |
---|
ModelElement(MetaModelElement type)
Creates a new element.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Comparator<ModelElement> |
getComparator()
Returns a comparator to sort model elements by the order in which they
are defined in the XMI file.
|
java.lang.String |
getFullName()
Gets the fully qualified name of this model element.
|
boolean |
getLinksIgnored()
Tests whether cross-references to this element should be ignored
according to the element filter settings.
|
java.lang.String |
getName()
Gets the name of this model element.
|
java.util.Collection<ModelElement> |
getOwnedElements()
Gets the model elements owned by this element.
|
ModelElement |
getOwner()
Gets the owner of this model element.
|
java.lang.String |
getPlainAttribute(java.lang.String attrName)
Retrieves the value of a single-valued data attribute for this model
element.
|
ModelElement |
getRefAttribute(java.lang.String attrName)
Retrieves the model element referenced by a single-valued cross-reference
attribute.
|
java.util.Collection<ModelElement> |
getRelations(java.lang.String relationName)
Returns the set of model elements that point to this model element via a
specified cross-reference attribute.
|
java.util.Collection<?> |
getSetAttribute(java.lang.String attrName)
Retrieves the set of values for a multi-valued attribute.
|
MetaModelElement |
getType()
Returns the metamodel element type of this model element.
|
java.lang.String |
getXMIID()
Gets the XMI ID of this model element.
|
java.lang.String |
toString()
Returns the XMI ID of the model element as its string representation.
|
public ModelElement(MetaModelElement type)
type
- The element type of the model element.public java.util.Collection<ModelElement> getRelations(java.lang.String relationName)
relationName
- Name of the cross-reference attribute.null
if there are no such referencing model elements.public java.lang.String getPlainAttribute(java.lang.String attrName)
attrName
- Name of the attribute.public ModelElement getRefAttribute(java.lang.String attrName)
attrName
- Name of the cross-reference attribute.null
if the
reference is empty or the reference should be ignored as per
filter settings.public java.util.Collection<?> getSetAttribute(java.lang.String attrName)
attrName
- Name of the multi-valued attribute.public boolean getLinksIgnored()
true
if the cross-references to this element should
be ignoredpublic MetaModelElement getType()
public java.lang.String getFullName()
public ModelElement getOwner()
null
for root model
elements.public java.util.Collection<ModelElement> getOwnedElements()
public java.lang.String getXMIID()
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.Comparator<ModelElement> getComparator()