org.argouml.uml.generator
Class Generator
java.lang.Object
|
+--org.argouml.uml.generator.Generator
- All Implemented Interfaces:
- NotationProvider
- Direct Known Subclasses:
- GeneratorDisplay, GeneratorJava
- public abstract class Generator
- extends java.lang.Object
- implements NotationProvider
This class is the abstract super class that defines a code
generation framework. It is basically a depth-first traversal of
the UML model that generates strings as it goes. This framework
should probably be redesigned to separate the traversal logic from
the generation logic. See the Vistor design
pattern in "Design Patterns", and the Demeter project.
Field Summary |
static java.lang.String |
INDENT
Two spaces used for indenting code in classes. |
static java.lang.String |
TEST_SUFFIX
suffix placed behind the tag defining a testcase for an element to be generated |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INDENT
public static java.lang.String INDENT
- Two spaces used for indenting code in classes.
TEST_SUFFIX
public static final java.lang.String TEST_SUFFIX
- suffix placed behind the tag defining a testcase for an element to be generated
Generator
public Generator(NotationName notationName)
getGenerator
public static Generator getGenerator(NotationName n)
getNotation
public NotationName getNotation()
- Specified by:
getNotation
in interface NotationProvider
generate
public java.lang.String generate(java.lang.Object o)
- Generates code for some modelelement. Subclasses should implement this to generate code for different notations.
- Parameters:
o
- the element to be generated- Returns:
- String the generated code
generateExtensionPoint
public abstract java.lang.String generateExtensionPoint(ru.novosoft.uml.behavior.use_cases.MExtensionPoint op)
- Specified by:
generateExtensionPoint
in interface NotationProvider
generateOperation
public abstract java.lang.String generateOperation(ru.novosoft.uml.foundation.core.MOperation op,
boolean documented)
- Specified by:
generateOperation
in interface NotationProvider
generateAttribute
public abstract java.lang.String generateAttribute(ru.novosoft.uml.foundation.core.MAttribute attr,
boolean documented)
- Specified by:
generateAttribute
in interface NotationProvider
generateParameter
public abstract java.lang.String generateParameter(ru.novosoft.uml.foundation.core.MParameter param)
- Specified by:
generateParameter
in interface NotationProvider
generatePackage
public abstract java.lang.String generatePackage(ru.novosoft.uml.model_management.MPackage p)
- Specified by:
generatePackage
in interface NotationProvider
generateClassifier
public abstract java.lang.String generateClassifier(ru.novosoft.uml.foundation.core.MClassifier cls)
- Specified by:
generateClassifier
in interface NotationProvider
generateTaggedValue
public abstract java.lang.String generateTaggedValue(ru.novosoft.uml.foundation.extension_mechanisms.MTaggedValue s)
- Specified by:
generateTaggedValue
in interface NotationProvider
generateAssociation
public abstract java.lang.String generateAssociation(ru.novosoft.uml.foundation.core.MAssociation a)
- Specified by:
generateAssociation
in interface NotationProvider
generateAssociationEnd
public abstract java.lang.String generateAssociationEnd(ru.novosoft.uml.foundation.core.MAssociationEnd ae)
- Specified by:
generateAssociationEnd
in interface NotationProvider
generateMultiplicity
public abstract java.lang.String generateMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity m)
- Specified by:
generateMultiplicity
in interface NotationProvider
generateState
public abstract java.lang.String generateState(ru.novosoft.uml.behavior.state_machines.MState m)
- Specified by:
generateState
in interface NotationProvider
generateTransition
public abstract java.lang.String generateTransition(ru.novosoft.uml.behavior.state_machines.MTransition m)
- Specified by:
generateTransition
in interface NotationProvider
generateAction
public abstract java.lang.String generateAction(ru.novosoft.uml.behavior.common_behavior.MAction m)
- Specified by:
generateAction
in interface NotationProvider
generateGuard
public abstract java.lang.String generateGuard(ru.novosoft.uml.behavior.state_machines.MGuard m)
- Specified by:
generateGuard
in interface NotationProvider
generateMessage
public abstract java.lang.String generateMessage(ru.novosoft.uml.behavior.collaborations.MMessage m)
- Specified by:
generateMessage
in interface NotationProvider
generateExpression
public java.lang.String generateExpression(ru.novosoft.uml.foundation.data_types.MExpression expr)
- Specified by:
generateExpression
in interface NotationProvider
generateExpression
public java.lang.String generateExpression(ru.novosoft.uml.foundation.core.MConstraint expr)
generateName
public java.lang.String generateName(java.lang.String n)
- Specified by:
generateName
in interface NotationProvider
generateUninterpreted
public java.lang.String generateUninterpreted(java.lang.String un)
generateClassifierRef
public java.lang.String generateClassifierRef(ru.novosoft.uml.foundation.core.MClassifier cls)
- Specified by:
generateClassifierRef
in interface NotationProvider
generateStereotype
public java.lang.String generateStereotype(ru.novosoft.uml.foundation.extension_mechanisms.MStereotype st)
- Specified by:
generateStereotype
in interface NotationProvider
isModuleEnabled
public boolean isModuleEnabled()
getModulePopUpActions
public java.util.Vector getModulePopUpActions(java.util.Vector v,
java.lang.Object o)
shutdownModule
public boolean shutdownModule()
initializeModule
public boolean initializeModule()
setModuleEnabled
public void setModuleEnabled(boolean enabled)
inContext
public boolean inContext(java.lang.Object[] o)
isTestModus
public boolean isTestModus()
- Returns the _testModus.
- Returns:
- boolean
setTestModus
public void setTestModus(boolean _testModus)
- Sets the _testModus.
- Parameters:
_testModus
- The _testModus to set
getCodePath
public static java.lang.String getCodePath(java.lang.Object me)
- Gets the path of the code base for a model element, otherwise null.
- Parameters:
me
- The model element- Returns:
- String