be.ac.vub.cocompose.lang.core
Interface ModelElement

All Superinterfaces:
Cloneable, Element, VisitedElement
All Known Subinterfaces:
AndConstraint, CompositeConstraint, Concept, Constraint, ElementConstraint, ImplementationGenerator, ImplementationPattern, ImplementationRolePart, Model, ModelProperty, Namespace, OrConstraint, Property, RefinedElement, Refinement, RelationElement, Relationship, Role, SimpleProperty, SolutionPattern
All Known Implementing Classes:
DefaultAndConstraint, DefaultCompositeConstraint, DefaultConcept, DefaultConstraint, DefaultElementConstraint, DefaultImplementationGenerator, DefaultImplementationPattern, DefaultImplementationRolePart, DefaultModel, DefaultModelElement, DefaultModelProperty, DefaultNamespace, DefaultOrConstraint, DefaultProperty, DefaultRefinedElement, DefaultRefinement, DefaultRelationElement, DefaultRelationship, DefaultRole, DefaultSimpleProperty, DefaultSolutionPattern

public interface ModelElement
extends Element, Cloneable, VisitedElement

Root interface for each CoCompose language element.

Since:
0.2.0
Version:
0.2.9, 27/04/2004
Author:
Dennis Wagelaar

Method Summary
 String getId()
          Gets the Id of this element, based upon its namespace.
 Model getModel()
          Gets the root model for this element, if any.
 String getName()
          Gets the name of this ModelElement.
 Namespace getNamespace()
          Gets the namespace that contains this element.
 Namespace getRootNamespace()
          Gets the root namespace for this element, if any.
 void setId(String id)
          Sets the Id of this element.
 void setName(String name)
          Sets the name of this ModelElement.
 void setNamespace(Namespace namespace)
          Sets the namespace that contains this element.
 
Methods inherited from interface be.ac.vub.cocompose.lang.Element
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface be.ac.vub.cocompose.lang.VisitedElement
accept
 

Method Detail

getName

public String getName()
Gets the name of this ModelElement.

Returns:
the name of this ModelElement.

setName

public void setName(String name)
             throws ModelElementException
Sets the name of this ModelElement.

Parameters:
name - - the name of this ModelElement.
Throws:
ModelElementException - - if the name is already used within the namespace.

getNamespace

public Namespace getNamespace()
Gets the namespace that contains this element.

Returns:
the namespace.

setNamespace

public void setNamespace(Namespace namespace)
Sets the namespace that contains this element.

Parameters:
namespace - - the namespace.

getId

public String getId()
Gets the Id of this element, based upon its namespace.

Returns:
the Id, or null if the namespace is not set.

setId

public void setId(String id)
Sets the Id of this element.

Parameters:
id - - the Id.

getRootNamespace

public Namespace getRootNamespace()
Gets the root namespace for this element, if any.

Returns:
the root namespace, if any.

getModel

public Model getModel()
Gets the root model for this element, if any.

Returns:
the root model, if any.