be.ac.vub.cocompose.lang.impl.core
Class DefaultModelElement

java.lang.Object
  extended bybe.ac.vub.cocompose.lang.impl.DefaultElement
      extended bybe.ac.vub.cocompose.lang.impl.core.DefaultModelElement
All Implemented Interfaces:
Cloneable, Element, ModelElement, VisitedElement
Direct Known Subclasses:
DefaultNamespace, DefaultRelationship

public abstract class DefaultModelElement
extends DefaultElement
implements ModelElement

Root class for each CoCompose language element.

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

Constructor Summary
DefaultModelElement()
           
 
Method Summary
 void accept(ModelVisitor modelVisitor)
          Accepts a visitor.
 String getId()
          Gets the Id of this element.
 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)
          Ignored.
 void setName(String name)
          Sets the name of this ModelElement.
 void setNamespace(Namespace namespace)
          Sets the namespace that contains this element.
 String toString()
           
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.DefaultElement
addPropertyChangeListener, firePropertyChange, fireStructureChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface be.ac.vub.cocompose.lang.Element
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultModelElement

public DefaultModelElement()
Method Detail

getName

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

Specified by:
getName in interface ModelElement
Returns:
the name of this ModelElement.

setName

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

Specified by:
setName in interface 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.

Specified by:
getNamespace in interface ModelElement
Returns:
the namespace.

setNamespace

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

Specified by:
setNamespace in interface ModelElement
Parameters:
namespace - - the namespace.

getId

public String getId()
Gets the Id of this element.

Specified by:
getId in interface ModelElement
Returns:
the Id.

setId

public void setId(String id)
Ignored.

Specified by:
setId in interface ModelElement
Parameters:
id - - the Id.

accept

public void accept(ModelVisitor modelVisitor)
            throws ModelElementException
Accepts a visitor.

Specified by:
accept in interface VisitedElement
Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException

toString

public String toString()
See Also:
Object.toString()

getRootNamespace

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

Specified by:
getRootNamespace in interface ModelElement
Returns:
the root namespace, if any.

getModel

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

Specified by:
getModel in interface ModelElement
Returns:
the root model, if any.