UML.Semantic.Foundation.Core
Class ModelElement

java.lang.Object
  |
  +--UML.Semantic.Foundation.Core.ModelElement
All Implemented Interfaces:
Element, ElementAtt, LinkAtt
Direct Known Subclasses:
Action, ActionSequence, Argument, AssociationEnd, AttributeLink, Comment, Constraint, Dependency, Event, Feature, Generalization, Guard, Instance, Interaction, Link, LinkEnd, MessageInstance, Namespace, Parameter, StateMachine, StateVertex, Transition

public abstract class ModelElement
extends java.lang.Object
implements Element

A model element is an element that is an abstraction drawn from the system being modeled. Contrast with view element, which is an element whose purpose is to provide a presentation of information for human comprehension.

In the metamodel a ModelElement is a named entity in a Model. It is the base for all modeling metaclasses in the UML. All other modeling metaclasses are either direct or indirect subclasses of ModelElement. ModelElement is an abstract metaclass.

Each ModelElement can be regarded as a template. A template has a set of templateParameters that denotes which of the parts of a ModelElement are the template parameters. A ModelElementis a template when there is at least one template parameter. If it is not a template, a ModelElement cannot have template parameters. However, such embedded parameters are not usually complete and need not satisfy well-formedness rules. It is the arguments supplied when the template is instantiated that must be well-formed.

Partially instantiated templates are allowed. This is the case when there are arguments provided for some, but not all templateParameters. A partially instantiated template is still a template, since it has still parameters.

Any model element may have arbitrary tagged values and constraints (subject to theses making sense). A model element may have at most one stereotype whose base class must match the UML class of the modeling element (such as Class, Association, Dependency, etc.). The presence of a stereotype may impose implicit constraints on the modeling element and may require the presence of specific tagged values.

See Also:
UML.Semantic.Foundation.AuxiliaryElements.UmlViewElement

Constructor Summary
ModelElement()
           
 
Method Summary
 void add(Locator locator)
          Adds a locator to the set of locators.
 void add(ModelElement elem)
          Adds an element into the Dictionary.
 boolean check()
          Checks if well-formedness rules are respected in this model element.
 java.lang.String getBindingList()
          Gets the binding list of this element template (if any).
 java.lang.String getConstraintList()
          Gets the constraint list of this element (if any).
 java.lang.String getElementType()
          Gets the type of this element.
 int getErrors()
          Gets the value of the errors attribute of this element.
 java.lang.String getHref()
          Gets the element href.
 java.lang.String getId()
          Gets the element identifier.
 java.lang.String getIdentification()
          Gets an element identification string.
 java.lang.String getIdref()
          Gets the element identifier reference.
 int getIndex()
          Gets the index of the Dictionary where this element is stored.
 void getInfo()
          Gets info on this element.
 boolean getIsOwned()
          Gets the value of the isOwned attribute.
 java.lang.String getLabel()
          Gets the element label.
 java.util.Vector getLocator()
          Gets the set of locators.
 java.lang.String getName()
          Gets the element name attribute.
 Namespace getNamespace()
          Gets the namespace which this element belongs to.
 java.lang.String getNamespaceId()
          Gets the identifier of the namespace which this element belongs to.
 Stereotype getStereotype()
          Gets the stereotype of this element.
 ModelElement getTemplate()
          Gets the template of this element.
 java.lang.String getTemplateParameterList()
          Gets the parameter list of this element template (if any).
 java.lang.String getTitle()
          Gets the element reference title.
 java.lang.String getUuid()
          Gets the element unique identifier.
 java.lang.String getUuidref()
          Gets the element unique identifier reference.
 java.lang.String getVisibility()
          Gets the current visibility kind.
 java.lang.String getVisibilitySymbol()
          Gets the current visibility kind symbol.
 int getWarnings()
          Gets the value of the warnings attribute of this element.
 void setElementType(java.lang.String type)
          Sets the type of this element.
 void setErrors(int n)
          Sets the value of the errors attribute of this element.
 void setHref(java.lang.String href)
          Sets the element href reference to given value.
 void setId(java.lang.String id)
          Sets the element identifier to given value.
 void setIdref(java.lang.String idref)
          Sets the element identifier reference to given value.
 void setIndex(int index)
          Sets the index of the Dictionary (where this element is stored) to given index.
 void setIsOwned(java.lang.String mode)
          Sets the value of the isOwned attribute.
 void setLabel(java.lang.String label)
          Sets the element label to given value.
 void setName(java.lang.String name)
          Sets the element name attribute to given value.
 void setNamespace(java.lang.String namespace)
          Sets the element namespace.
 void setTemplate(java.lang.String template)
          Sets the template of this element.
 void setTitle(java.lang.String title)
          Sets the element reference title to given value.
 void setUuid(java.lang.String uuid)
          Sets the element unique identifier to given value.
 void setUuidref(java.lang.String uuidref)
          Sets the element unique identifier reference to given value.
 void setVisibility(java.lang.String mode)
          Sets the element visibility to the given kind.
 void setWarnings(int n)
          Sets the value of the warnings attribute of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelElement

public ModelElement()
Method Detail

setId

public void setId(java.lang.String id)
Sets the element identifier to given value.

Specified by:
setId in interface ElementAtt

setLabel

public void setLabel(java.lang.String label)
Sets the element label to given value.

Specified by:
setLabel in interface ElementAtt

setUuid

public void setUuid(java.lang.String uuid)
Sets the element unique identifier to given value.

Specified by:
setUuid in interface ElementAtt

setHref

public void setHref(java.lang.String href)
Sets the element href reference to given value.

Specified by:
setHref in interface LinkAtt

setTitle

public void setTitle(java.lang.String title)
Sets the element reference title to given value.

Specified by:
setTitle in interface LinkAtt

add

public void add(Locator locator)
Adds a locator to the set of locators.


setIdref

public void setIdref(java.lang.String idref)
Sets the element identifier reference to given value.

Specified by:
setIdref in interface LinkAtt

setUuidref

public void setUuidref(java.lang.String uuidref)
Sets the element unique identifier reference to given value.

Specified by:
setUuidref in interface LinkAtt

getId

public java.lang.String getId()
Gets the element identifier.

Specified by:
getId in interface ElementAtt
Returns:
The identifier string.

getLabel

public java.lang.String getLabel()
Gets the element label.

Specified by:
getLabel in interface ElementAtt
Returns:
The label string.

getUuid

public java.lang.String getUuid()
Gets the element unique identifier.

Specified by:
getUuid in interface ElementAtt
Returns:
The unique identifier string.

getHref

public java.lang.String getHref()
Gets the element href.

Specified by:
getHref in interface LinkAtt
Returns:
The href string.

getTitle

public java.lang.String getTitle()
Gets the element reference title.

Returns:
The title string.

getLocator

public java.util.Vector getLocator()
Gets the set of locators.

Returns:
A set of locators.

getIdref

public java.lang.String getIdref()
Gets the element identifier reference.

Specified by:
getIdref in interface LinkAtt
Returns:
The identifier reference string.

getUuidref

public java.lang.String getUuidref()
Gets the element unique identifier reference.

Specified by:
getUuidref in interface LinkAtt
Returns:
The unique identifier reference string.

setName

public void setName(java.lang.String name)
Sets the element name attribute to given value.


getName

public java.lang.String getName()
Gets the element name attribute.

Returns:
The element name string.

getIdentification

public java.lang.String getIdentification()
Gets an element identification string. The string is the element name (if defeined) otherwise the element identifier.

Returns:
The identifiaction string.

setNamespace

public void setNamespace(java.lang.String namespace)
Sets the element namespace.


getNamespace

public Namespace getNamespace()
Gets the namespace which this element belongs to.

Returns:
A Namespace object.

getNamespaceId

public java.lang.String getNamespaceId()
Gets the identifier of the namespace which this element belongs to.

Returns:
A Namespace identifier.

setVisibility

public void setVisibility(java.lang.String mode)
Sets the element visibility to the given kind.


getVisibility

public java.lang.String getVisibility()
Gets the current visibility kind.

Returns:
The current visibility kind.

getVisibilitySymbol

public java.lang.String getVisibilitySymbol()
Gets the current visibility kind symbol.

Returns:
The current visibility symbol.

getStereotype

public Stereotype getStereotype()
Gets the stereotype of this element.

Returns:
A Stereotype object.

setTemplate

public void setTemplate(java.lang.String template)
Sets the template of this element.


getTemplate

public ModelElement getTemplate()
Gets the template of this element.

Returns:
A Template object.

getTemplateParameterList

public java.lang.String getTemplateParameterList()
Gets the parameter list of this element template (if any).

Returns:
A string containing template parameters.

getBindingList

public java.lang.String getBindingList()
Gets the binding list of this element template (if any).

Returns:
A string containing template bindings.

getConstraintList

public java.lang.String getConstraintList()
Gets the constraint list of this element (if any).

Returns:
A string containing element constraints.

setElementType

public void setElementType(java.lang.String type)
Sets the type of this element.


getElementType

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

Returns:
A string representing element type.

setIsOwned

public void setIsOwned(java.lang.String mode)
Sets the value of the isOwned attribute.


getIsOwned

public boolean getIsOwned()
Gets the value of the isOwned attribute.

Returns:
A true or false value

setIndex

public void setIndex(int index)
Sets the index of the Dictionary (where this element is stored) to given index.


getIndex

public int getIndex()
Gets the index of the Dictionary where this element is stored.

Returns:
The index where the element is stored.

setWarnings

public void setWarnings(int n)
Sets the value of the warnings attribute of this element.


getWarnings

public int getWarnings()
Gets the value of the warnings attribute of this element.

Returns:
An int value.

setErrors

public void setErrors(int n)
Sets the value of the errors attribute of this element.


getErrors

public int getErrors()
Gets the value of the errors attribute of this element.


add

public void add(ModelElement elem)
Adds an element into the Dictionary.

See Also:
Dictionary

check

public boolean check()
Checks if well-formedness rules are respected in this model element.

Returns:
True if check was successful, false otherwise.

getInfo

public void getInfo()
Gets info on this element.