org.argouml.model
Interface ExtensionMechanismsHelper

All Known Implementing Classes:
AbstractExtensionMechanismsHelperDecorator

public interface ExtensionMechanismsHelper

The interface for the helper of the ExtensionMechanisms.

Created from the old ExtensionMechanismsHelper.


Method Summary
 void addBaseClass(Object handle, Object baseClass)
          Add a baseclass to some stereotype.
 void addCopyStereotype(Object modelElement, Object stereotype)
          Sets the stereotype of some modelelement.
 void addExtendedElement(Object handle, Object extendedElement)
          Add an extended element to a stereotype.
 void addTaggedValue(Object handle, Object taggedValue)
          Add a tagged value.
 Collection getAllPossibleStereotypes(Collection models, Object modelElement)
          Returns all possible stereotypes for some modelelement.
 String getMetaModelName(Object m)
           
 Object getStereotype(Collection models, Object stereo)
          Searches for a stereotype just like the given stereotype in all given models.
 Object getStereotype(Object ns, Object stereo)
          Finds a stereotype in some namespace, but not in its subnamespaces.
 Collection getStereotypes(Collection models)
          Get all stereotypes from all Models in the list.
 Collection getStereotypes(Object ns)
          Returns all stereotypes in a namespace, but not those in a subnamespace.
 boolean hasStereoType(Object handle, String name)
          Returns true if the given object has a stereotype with the given name.
 boolean isStereotype(Object object, String name, String base)
          Tests if a stereotype is a stereotype with some name and base class.
 boolean isStereotypeInh(Object object, String name, String base)
          Tests if a stereotype is or inherits from a stereotype with some name and base class.
 boolean isValidStereoType(Object theModelElement, Object theStereotype)
          Returns true if the given stereotype has a baseclass that equals the baseclass of the given modelelement or one of the superclasses of the given modelelement.
 void removeBaseClass(Object handle, Object baseClass)
          Remove baseclass from some stereotype.
 void removeTaggedValue(Object handle, Object taggedValue)
          Remove a tagged value.
 void setBaseClass(Object handle, Object baseClass)
          Deprecated. use addBaseClass
 void setIcon(Object handle, Object icon)
          Set the icon for a stereotype.
 void setTag(Object handle, Object tag)
          Set the Tag of a TaggedValue.
 void setTaggedValue(Object handle, Collection taggedValues)
          Se the list of tagged values for a model element.
 void setType(Object handle, Object type)
          Set the type of a taggedvalue.
 void setValueOfTag(Object handle, String value)
          Sets a value of some taggedValue.
 

Method Detail

getStereotypes

public Collection getStereotypes(Object ns)
Returns all stereotypes in a namespace, but not those in a subnamespace.

Parameters:
ns - is the namespace.
Returns:
a Collection with the stereotypes.

getStereotype

public Object getStereotype(Object ns,
                            Object stereo)
Finds a stereotype in some namespace, but not in its subnamespaces. Returns null if no such stereotype is found. TODO: What if stereo.getName() or stereo.getBaseClass() is null? Then you know immediately that none will be found, but is that the correct answer?

Parameters:
ns - is the namespace.
stereo - is the stereotype.
Returns:
the stereotype found or null.

getStereotype

public Object getStereotype(Collection models,
                            Object stereo)
Searches for a stereotype just like the given stereotype in all given models. The given stereotype can not have its namespace set yet; otherwise it will be returned itself! TODO: Should it only search for stereotypes owned by the Model object?

Parameters:
models - a collection of models
stereo - is the given stereotype
Returns:
Stereotype

getMetaModelName

public String getMetaModelName(Object m)
Parameters:
m - the ModelElement
Returns:
the meta name of the ModelElement

getAllPossibleStereotypes

public Collection getAllPossibleStereotypes(Collection models,
                                            Object modelElement)
Returns all possible stereotypes for some modelelement. Possible stereotypes are those stereotypes that are owned by the same namespace the modelelement is owned by and that have a baseclass that is the same as the metamodelelement name of the modelelement.

Parameters:
modelElement - is the model element
models - the models to search in
Returns:
Collection

isValidStereoType

public boolean isValidStereoType(Object theModelElement,
                                 Object theStereotype)
Returns true if the given stereotype has a baseclass that equals the baseclass of the given modelelement or one of the superclasses of the given modelelement.

Parameters:
theModelElement - is the model element
theStereotype - is the stereotype
Returns:
boolean

getStereotypes

public Collection getStereotypes(Collection models)
Get all stereotypes from all Models in the list. Finds only stereotypes owned by the Model objects themselves.

Parameters:
models - the models to search
Returns:
the collection of stereotypes in all models in the current project

addCopyStereotype

public void addCopyStereotype(Object modelElement,
                              Object stereotype)
Sets the stereotype of some modelelement. The method also copies a stereotype that is not a part of the current model to the current model.

Parameters:
modelElement - is the model element
stereotype - is the stereotype

isStereotype

public boolean isStereotype(Object object,
                            String name,
                            String base)
Tests if a stereotype is a stereotype with some name and base class.

Parameters:
object - is the stereotype.
name - is the name of the stereotype.
base - is the base class of the stereotype.
Returns:
true if object is a stereotype with the desired characteristics.

isStereotypeInh

public boolean isStereotypeInh(Object object,
                               String name,
                               String base)
Tests if a stereotype is or inherits from a stereotype with some name and base class.

Parameters:
object - is the stereotype.
name - is the name of the stereotype.
base - is the base class of the stereotype.
Returns:
true if object is a (descendant of a) stereotype with the desired characteristics.

addExtendedElement

public void addExtendedElement(Object handle,
                               Object extendedElement)
Add an extended element to a stereotype.

Parameters:
handle - Stereotype
extendedElement - ExtensionPoint

setBaseClass

public void setBaseClass(Object handle,
                         Object baseClass)
Deprecated. use addBaseClass

Set the baseclass of some stereotype.

Parameters:
handle - the stereotype
baseClass - the baseclass

addBaseClass

public void addBaseClass(Object handle,
                         Object baseClass)
Add a baseclass to some stereotype.

Parameters:
handle - the stereotype
baseClass - the baseclass to add

removeBaseClass

public void removeBaseClass(Object handle,
                            Object baseClass)
Remove baseclass from some stereotype.

Parameters:
handle - the stereotype
baseClass - the baseclass to remove

setIcon

public void setIcon(Object handle,
                    Object icon)
Set the icon for a stereotype.

Parameters:
handle - Stereotype
icon - String

setTag

public void setTag(Object handle,
                   Object tag)
Set the Tag of a TaggedValue.

Parameters:
handle - TaggedValue
tag - String

setType

public void setType(Object handle,
                    Object type)
Set the type of a taggedvalue.

Parameters:
handle - the taggedValue
type - the tagDefinition

setValueOfTag

public void setValueOfTag(Object handle,
                          String value)
Sets a value of some taggedValue.

Parameters:
handle - is the tagged value
value - is the value

addTaggedValue

public void addTaggedValue(Object handle,
                           Object taggedValue)
Add a tagged value.

Parameters:
handle - The model element to add to.
taggedValue - The tagged value to add.

removeTaggedValue

public void removeTaggedValue(Object handle,
                              Object taggedValue)
Remove a tagged value.

Parameters:
handle - The model element to remove from.
taggedValue - The tagged value to remove.

setTaggedValue

public void setTaggedValue(Object handle,
                           Collection taggedValues)
Se the list of tagged values for a model element.

Parameters:
handle - The model element to set for.
taggedValues - A Collection of tagged values.

hasStereoType

public boolean hasStereoType(Object handle,
                             String name)
Returns true if the given object has a stereotype with the given name.

Parameters:
handle - the given object
name - the given name
Returns:
true if there is such a stereotype


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook