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

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

public class DefaultRelationship
extends DefaultModelElement
implements Relationship, PropertyChangeListener

Interface for relationships between CoCompose language elements.

Since:
0.2.0
Version:
0.2.12, 19/05/2004
Author:
Dennis Wagelaar

Constructor Summary
DefaultRelationship()
           
 
Method Summary
 void accept(ModelVisitor modelVisitor)
          Accepts a visitor.
 RelationElement getSourceParticipant()
          Gets the first participant in this relationship.
 RelationElement getTargetParticipant()
          Gets the second participant in this relationship.
 void propertyChange(PropertyChangeEvent evt)
           
protected  void registerElement(ModelElement element)
          Registers as a listener with the given element, so that name changes will be propagated.
 void setName(String name)
          Sets the name of this ModelElement.
 void setSourceParticipant(RelationElement sourceParticipant)
          Sets the first participant in this relationship.
 void setTargetParticipant(RelationElement targetParticipant)
          Sets the second participant in this relationship.
protected  void unregisterElement(ModelElement element)
          Unregisters as a listener with the given element, so that name changes will no longer be propagated.
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultModelElement
getId, getModel, getName, getNamespace, getRootNamespace, setId, setNamespace, 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.core.ModelElement
getId, getModel, getName, getNamespace, getRootNamespace, setId, setNamespace
 
Methods inherited from interface be.ac.vub.cocompose.lang.Element
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultRelationship

public DefaultRelationship()
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

accept

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

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

getSourceParticipant

public RelationElement getSourceParticipant()
Gets the first participant in this relationship.

Specified by:
getSourceParticipant in interface Relationship
Returns:
the source participant.

setSourceParticipant

public void setSourceParticipant(RelationElement sourceParticipant)
Sets the first participant in this relationship.

Specified by:
setSourceParticipant in interface Relationship
Parameters:
sourceParticipant - - the source participant.

getTargetParticipant

public RelationElement getTargetParticipant()
Gets the second participant in this relationship.

Specified by:
getTargetParticipant in interface Relationship
Returns:
the target participant.

setTargetParticipant

public void setTargetParticipant(RelationElement targetParticipant)
Sets the second participant in this relationship.

Specified by:
setTargetParticipant in interface Relationship
Parameters:
targetParticipant - - the target participant.

setName

public void setName(String name)
             throws ModelElementException
Description copied from interface: ModelElement
Sets the name of this ModelElement.

Specified by:
setName in interface ModelElement
Overrides:
setName in class DefaultModelElement
Parameters:
name - - the name of this ModelElement.
Throws:
ModelElementException - - if the name is already used within the namespace.
See Also:
ModelElement.setName(java.lang.String)

registerElement

protected void registerElement(ModelElement element)
Registers as a listener with the given element, so that name changes will be propagated.

Parameters:
element - the element.

unregisterElement

protected void unregisterElement(ModelElement element)
Unregisters as a listener with the given element, so that name changes will no longer be propagated.

Parameters:
element - the element.