org.argouml.model.uml
Class ExtensionMechanismsFactoryImpl

java.lang.Object
  extended byorg.argouml.model.uml.AbstractUmlModelFactory
      extended byorg.argouml.model.uml.ExtensionMechanismsFactoryImpl
All Implemented Interfaces:
org.argouml.model.ExtensionMechanismsFactory

public class ExtensionMechanismsFactoryImpl
extends AbstractUmlModelFactory
implements org.argouml.model.ExtensionMechanismsFactory

Factory to create UML classes for the UML Foundation::ExtensionMechanisms package. TODO: Change visibility to package after reflection problem solved.

Since:
ARGO0.11.2

Field Summary
private  NSUMLModelImplementation nsmodel
          The model implementation.
 
Constructor Summary
(package private) ExtensionMechanismsFactoryImpl(NSUMLModelImplementation implementation)
          Don't allow instantiation.
 
Method Summary
 Object buildStereotype(Object theModelElementObject, Object theName, Object theNamespaceObject)
          Builds a stereotype for some kind of modelelement.
 Object buildStereotype(Object theModelElementObject, String theName, Object model, Collection models)
          Builds an initialized stereotype.
 Object buildStereotype(String text, Object ns)
          Builds an initialized stereotype.
 Object buildTaggedValue(String tag, String value)
          Build an initialized instance of a UML TaggedValue.
 Object copyStereotype(Object source, Object ns)
          Copies a stereotype.
 Object createStereotype()
          Create an empty but initialized instance of a UML Stereotype.
 Object createTaggedValue()
          Create an empty but initialized instance of a UML TaggedValue.
(package private)  void deleteStereotype(Object elem)
           
(package private)  void deleteTaggedValue(Object elem)
           
private  void doCopyStereotype(ru.novosoft.uml.foundation.extension_mechanisms.MStereotype source, ru.novosoft.uml.foundation.extension_mechanisms.MStereotype target)
          Used by the copy functions.
 
Methods inherited from class org.argouml.model.uml.AbstractUmlModelFactory
addListenersToModelElement, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsmodel

private NSUMLModelImplementation nsmodel
The model implementation.

Constructor Detail

ExtensionMechanismsFactoryImpl

ExtensionMechanismsFactoryImpl(NSUMLModelImplementation implementation)
Don't allow instantiation.

Parameters:
implementation - To get other helpers and factories.
Method Detail

createStereotype

public Object createStereotype()
Create an empty but initialized instance of a UML Stereotype.

Specified by:
createStereotype in interface org.argouml.model.ExtensionMechanismsFactory
Returns:
an initialized UML Stereotype instance.

createTaggedValue

public Object createTaggedValue()
Create an empty but initialized instance of a UML TaggedValue.

Specified by:
createTaggedValue in interface org.argouml.model.ExtensionMechanismsFactory
Returns:
an initialized UML TaggedValue instance.

buildStereotype

public Object buildStereotype(Object theModelElementObject,
                              Object theName,
                              Object theNamespaceObject)
Builds a stereotype for some kind of modelelement. TODO: MVW: This needs rethinking/rework! I have the following questions: Why does it not search for a stereotype in the namespace using properties and only create a new stereotype if it will actually be used? Ie, why is there not a getStereotype(String name, String baseClass)? (edited by d00mst)

Specified by:
buildStereotype in interface org.argouml.model.ExtensionMechanismsFactory
Parameters:
theModelElementObject - a Model Element that the stereotype will be applied to. The stereotype will have its BaseClass set to an appropriate value for this kind of Model Elements.
theName - the name for the stereotype
theNamespaceObject - the namespace the stereotype will be created within.
Returns:
the resulting stereotype object
Throws:
IllegalArgumentException - if either argument is null.

buildStereotype

public Object buildStereotype(Object theModelElementObject,
                              String theName,
                              Object model,
                              Collection models)
Builds an initialized stereotype.

Specified by:
buildStereotype in interface org.argouml.model.ExtensionMechanismsFactory
Parameters:
theModelElementObject - the baseclass for the new stereotype
theName - the name for the new stereotype
model - the current model of interest
models - all the models
Returns:
the new stereotype

buildStereotype

public Object buildStereotype(String text,
                              Object ns)
Builds an initialized stereotype.

Specified by:
buildStereotype in interface org.argouml.model.ExtensionMechanismsFactory
Parameters:
text - is the name of the stereotype
ns - namespace where the stereotype lives (is known)
Returns:
an initialized stereotype.

buildTaggedValue

public Object buildTaggedValue(String tag,
                               String value)
Build an initialized instance of a UML TaggedValue.

Specified by:
buildTaggedValue in interface org.argouml.model.ExtensionMechanismsFactory
Parameters:
tag - is the tag name (a String).
value - is the value (a String).
Returns:
an initialized UML TaggedValue instance.

deleteStereotype

void deleteStereotype(Object elem)
Parameters:
elem - the stereotype

deleteTaggedValue

void deleteTaggedValue(Object elem)
Parameters:
elem - the taggedvalue

copyStereotype

public Object copyStereotype(Object source,
                             Object ns)
Copies a stereotype.

Specified by:
copyStereotype in interface org.argouml.model.ExtensionMechanismsFactory
Parameters:
source - is the stereotype to copy.
ns - is the namespace to put the copy in.
Returns:
a newly created stereotype

doCopyStereotype

private void doCopyStereotype(ru.novosoft.uml.foundation.extension_mechanisms.MStereotype source,
                              ru.novosoft.uml.foundation.extension_mechanisms.MStereotype target)
Used by the copy functions. Do not call this function directly.

Parameters:
source - The stereotype to copy from.
target - The object becoming a copy.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook