net.sourceforge.nrl.parser.model
Interface IModelElement

All Known Subinterfaces:
IClassifier, IDataType, IEnumerationLiteral, IPackage
All Known Implementing Classes:
AbstractClassifier, AbstractModelElement, AbstractPackage, UML2Classifier, UML2DataType, UML2Package, XSDClassifier, XSDDataType, XSDPackage

public interface IModelElement

A model element has a name and an optional parent element through inheritance.


Nested Class Summary
static class IModelElement.ElementType
          A short summary of what sort of model element this is.
 
Method Summary
 IPackage getContainingPackage()
          Return the package containing this model element
 List<IModelElement> getDescendants(boolean transitive)
          Return a list of elements that inherit fromm this.
 List<String> getDocumentation()
          Return any documentation associated with the element.
 IModelElement.ElementType getElementType()
          Return an enum indicating what type of element this is, to reduce the need to sub-cast prematurely.
 String getName()
          Return the model element's name.
 String getOriginalName()
          Some elements have to be renamed on loading.
 IModelElement getParent()
          Return the parent, if there is an inheritance relationship, or null if none.
 String getQualifiedName()
          Return a fully qualified name for this element, listing all the package it is contained in.
 Object getUserData(String key)
          Return user data stored on this model element.
 boolean isAssignableFrom(IModelElement other)
          Return true if the model element can be assigned the value of another in an expression.
 boolean isSupplementary()
          Returns a flag indicating whether the element is a supplementary element loaded from a type library or dependent model.
 void setUserData(String key, Object data)
          Set user data to be stored on this model element.
 

Method Detail

getContainingPackage

IPackage getContainingPackage()
Return the package containing this model element

Returns:
the package

getDocumentation

List<String> getDocumentation()
Return any documentation associated with the element.

Returns:
the documentation as a list of strings, or an empty list

getElementType

IModelElement.ElementType getElementType()
Return an enum indicating what type of element this is, to reduce the need to sub-cast prematurely.

Returns:
the element type

getName

String getName()
Return the model element's name.

Returns:
the name

getParent

IModelElement getParent()
Return the parent, if there is an inheritance relationship, or null if none.

Returns:
the parent or null

getDescendants

List<IModelElement> getDescendants(boolean transitive)
Return a list of elements that inherit fromm this.

Parameters:
transitive - if true, return children of children recursively
Returns:
the children, may be an empty list

getOriginalName

String getOriginalName()
Some elements have to be renamed on loading. For example, XML schema elements or UML classes that have a dot in them have their dots stripped out by the NRL model loader, otherwise they cannot be used. In these cases, this method will return the original name found in the model.

In all other cases, the method returns the same as getName().

Returns:
the original name

getQualifiedName

String getQualifiedName()
Return a fully qualified name for this element, listing all the package it is contained in.

Returns:
the fully qualified name

getUserData

Object getUserData(String key)
Return user data stored on this model element. This can be used to attach and retrieve processing information.

Parameters:
key - the key under which the data is stored
Returns:
the data or null if not present

isAssignableFrom

boolean isAssignableFrom(IModelElement other)
Return true if the model element can be assigned the value of another in an expression. In a typical object-oriented model, any superclass is assignable from subclass objects, but not the other way round.

Parameters:
other - the assigned object
Returns:
true if the object can be assigned

isSupplementary

boolean isSupplementary()
Returns a flag indicating whether the element is a supplementary element loaded from a type library or dependent model. This is necessary to distinguish primary business model types from those loaded from the UML2 type library, HyperModel or other sources.

Returns:
true if the element is supplementary

setUserData

void setUserData(String key,
                 Object data)
Set user data to be stored on this model element. This can be used to attach and retrieve processing information.

Parameters:
key - the key under which the data is stored
data - the data


Copyright © 2006-2010 Christian Nentwich and others