|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--org.argouml.uml.generator.Generator
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 | |
|---|---|
private NotationName |
_notationName
|
private boolean |
_testModus
Special modus for testing using the JUnit module. |
static java.lang.String |
INDENT
Two spaces used for indenting code in classes. |
private static java.util.Map |
s_generators
|
static java.lang.String |
TEST_SUFFIX
suffix placed behind the tag defining a testcase for an element to be generated |
| Fields inherited from interface org.argouml.application.api.Pluggable |
|---|
PLUGIN_PREFIX, PLUGIN_TITLE, PLUGIN_VENDOR |
| Fields inherited from interface org.argouml.application.api.ArgoModule |
|---|
cat, MODULEFILENAME, MODULEFILENAME_ALTERNATE |
| Constructor Summary | |
|---|---|
Generator(NotationName notationName)
|
|
| Method Summary | |
|---|---|
java.lang.String |
generate(java.lang.Object o)
Generates code for some modelelement. |
abstract java.lang.String |
generateAction(java.lang.Object m)
|
abstract java.lang.String |
generateAssociation(MAssociation a)
|
abstract java.lang.String |
generateAssociationEnd(MAssociationEnd ae)
|
abstract java.lang.String |
generateAttribute(MAttribute attr,
boolean documented)
|
abstract java.lang.String |
generateClassifier(MClassifier cls)
|
java.lang.String |
generateClassifierRef(java.lang.Object cls)
|
java.lang.String |
generateExpression(MExpression expr)
|
abstract java.lang.String |
generateExtensionPoint(MExtensionPoint op)
|
abstract java.lang.String |
generateGuard(MGuard m)
|
abstract java.lang.String |
generateMessage(MMessage m)
|
abstract java.lang.String |
generateMultiplicity(MMultiplicity m)
|
java.lang.String |
generateName(java.lang.String n)
|
abstract java.lang.String |
generateOperation(MOperation op,
boolean documented)
|
abstract java.lang.String |
generatePackage(MPackage p)
|
abstract java.lang.String |
generateParameter(MParameter param)
|
abstract java.lang.String |
generateState(MState m)
|
java.lang.String |
generateStereotype(MStereotype st)
|
abstract java.lang.String |
generateTaggedValue(MTaggedValue s)
|
abstract java.lang.String |
generateTransition(MTransition m)
|
java.lang.String |
generateUninterpreted(java.lang.String un)
|
abstract java.lang.String |
generateVisibility(MVisibilityKind visibility)
|
static java.lang.String |
getCodePath(java.lang.Object me)
Gets the path of the code base for a model element, otherwise null. |
static Generator |
getGenerator(NotationName n)
|
java.util.Vector |
getModulePopUpActions(java.util.Vector v,
java.lang.Object o)
Calls all modules to let them add to a popup menu. |
NotationName |
getNotation()
|
boolean |
inContext(java.lang.Object[] o)
A function which allows a plug-in to decide if it is available under a specific context. |
boolean |
initializeModule()
Method called when Argo is loading a module. |
boolean |
isModuleEnabled()
The default for any Generator is to be enabled. |
boolean |
isTestModus()
Returns the _testModus. |
void |
setModuleEnabled(boolean enabled)
Called to enable or disable a module programmatically. |
void |
setTestModus(boolean _testModus)
Sets the _testModus. |
boolean |
shutdownModule()
Method called when Argo is unloading a module. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.argouml.application.api.NotationProvider |
|---|
canParse, canParse, generateAssociationRole, generateStateBody |
| Methods inherited from interface org.argouml.application.api.ArgoModule |
|---|
getModuleAuthor, getModuleDescription, getModuleKey, getModuleName, getModuleVersion |
| Field Detail |
private boolean _testModus
private NotationName _notationName
public static java.lang.String INDENT
private static java.util.Map s_generators
public static final java.lang.String TEST_SUFFIX
| Constructor Detail |
public Generator(NotationName notationName)
| Method Detail |
public static Generator getGenerator(NotationName n)
public NotationName getNotation()
getNotation in interface NotationProviderpublic java.lang.String generate(java.lang.Object o)
o - the element to be generated
public abstract java.lang.String generateExtensionPoint(MExtensionPoint op)
generateExtensionPoint in interface NotationProvider
public abstract java.lang.String generateOperation(MOperation op,
boolean documented)
generateOperation in interface NotationProvider
public abstract java.lang.String generateAttribute(MAttribute attr,
boolean documented)
generateAttribute in interface NotationProviderpublic abstract java.lang.String generateParameter(MParameter param)
generateParameter in interface NotationProviderpublic abstract java.lang.String generatePackage(MPackage p)
generatePackage in interface NotationProviderpublic abstract java.lang.String generateClassifier(MClassifier cls)
generateClassifier in interface NotationProviderpublic abstract java.lang.String generateTaggedValue(MTaggedValue s)
generateTaggedValue in interface NotationProviderpublic abstract java.lang.String generateAssociation(MAssociation a)
generateAssociation in interface NotationProviderpublic abstract java.lang.String generateAssociationEnd(MAssociationEnd ae)
generateAssociationEnd in interface NotationProviderpublic abstract java.lang.String generateMultiplicity(MMultiplicity m)
generateMultiplicity in interface NotationProviderpublic abstract java.lang.String generateState(MState m)
generateState in interface NotationProviderpublic abstract java.lang.String generateTransition(MTransition m)
generateTransition in interface NotationProviderpublic abstract java.lang.String generateAction(java.lang.Object m)
generateAction in interface NotationProviderpublic abstract java.lang.String generateGuard(MGuard m)
generateGuard in interface NotationProviderpublic abstract java.lang.String generateMessage(MMessage m)
generateMessage in interface NotationProviderpublic abstract java.lang.String generateVisibility(MVisibilityKind visibility)
generateVisibility in interface NotationProviderpublic java.lang.String generateExpression(MExpression expr)
generateExpression in interface NotationProviderpublic java.lang.String generateName(java.lang.String n)
generateName in interface NotationProviderpublic java.lang.String generateUninterpreted(java.lang.String un)
public java.lang.String generateClassifierRef(java.lang.Object cls)
generateClassifierRef in interface NotationProviderpublic java.lang.String generateStereotype(MStereotype st)
generateStereotype in interface NotationProvider
public java.util.Vector getModulePopUpActions(java.util.Vector v,
java.lang.Object o)
ArgoModule
getModulePopUpActions in interface ArgoModulev - Vector of actionso - which the actions are valid forpublic boolean shutdownModule()
ArgoModule
shutdownModule in interface ArgoModulepublic boolean initializeModule()
ArgoModule
initializeModule in interface ArgoModulepublic void setModuleEnabled(boolean enabled)
ArgoModule
setModuleEnabled in interface ArgoModuleenabled - true to enable module, false to disablepublic boolean inContext(java.lang.Object[] o)
Pluggable
inContext in interface Pluggableo - An identification of the context.
The interpretation of criteria is specific to
the plug-in type, but must be consistent
across that type. The plug-in must want
to be exposed to all contexts.
public boolean isTestModus()
public void setTestModus(boolean _testModus)
_testModus - The _testModus to setpublic static java.lang.String getCodePath(java.lang.Object me)
me - The model element
public boolean isModuleEnabled()
isModuleEnabled in interface ArgoModuleArgoModule.isModuleEnabled()
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
| ArgoUML © 1996-2004 (20040306) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |