|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.uml.generator.Generator2
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 Visitor design pattern in "Design Patterns", and the Demeter project.
Field Summary | |
private static Map |
generators
|
static String |
INDENT
Two spaces used for indenting code in classes. |
private NotationName |
notationName
|
Fields inherited from interface org.argouml.application.api.Pluggable |
PLUGIN_PREFIX, PLUGIN_TITLE, PLUGIN_VENDOR |
Fields inherited from interface org.argouml.application.api.ArgoModule |
MODULEFILENAME, MODULEFILENAME_ALTERNATE |
Constructor Summary | |
Generator2(NotationName name)
Constructor that sets the name of this notation. |
Method Summary | |
String |
generate(Object o)
Generates code for some modelelement. |
abstract String |
generateAction(Object m)
Generate the String representation for an Action. |
abstract String |
generateAssociation(Object a)
Generate the String representation for an Association. |
abstract String |
generateAssociationEnd(Object ae)
Generate the String representation for an AssociationEnd. |
abstract String |
generateAttribute(Object attr,
boolean documented)
Generate the String representation for an Attribute. |
abstract String |
generateClassifier(Object cls)
Generate the String representation for a Classifier. |
String |
generateClassifierRef(Object cls)
Generate the String representation for a ClassifierRef. |
abstract String |
generateEvent(Object m)
Generate the String representation for an Event. |
String |
generateExpression(Object expr)
Generate the String representation for an Expression. |
abstract String |
generateExtensionPoint(Object op)
Generate the String representation for an ExtensionPoint. |
abstract String |
generateGuard(Object m)
Generate the String representation for a Guard. |
abstract String |
generateMessage(Object m)
Generate the String representation for a Message. |
abstract String |
generateMultiplicity(Object m)
Generate the String representation for an Multiplicity. |
String |
generateName(String n)
Convert a String to a name. |
abstract String |
generateObjectFlowState(Object m)
Generate the String representation for a ObjectFlowState. |
abstract String |
generateOperation(Object op,
boolean documented)
Generate the String representation for an Operation. |
abstract String |
generatePackage(Object p)
Generate the String representation for a Package. |
abstract String |
generateParameter(Object param)
Generate the String representation for a Parameter. |
abstract String |
generateState(Object m)
Generate the String representation for a State. |
String |
generateStereotype(Object st)
Generate the String representation for a Stereotype. |
abstract String |
generateSubmachine(Object m)
Generate the String representation for a Submachine. |
abstract String |
generateTaggedValue(Object s)
Generate the String representation for a TaggedValue. |
abstract String |
generateTransition(Object m)
Generate the String representation for a Transition. |
String |
generateUninterpreted(String un)
Make a string non-null. |
abstract String |
generateVisibility(Object m)
Generate the String representation for a Visibility. |
static String |
getCodePath(Object me)
Gets the path of the code base for a model element. |
static Generator2 |
getGenerator(NotationName n)
Access method that finds the correct generator based on a name. |
Vector |
getModulePopUpActions(Vector v,
Object o)
Calls all modules to let them add to a popup menu. |
NotationName |
getNotation()
|
boolean |
inContext(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. |
void |
setModuleEnabled(boolean enabled)
Called to enable or disable a module programmatically. |
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.NotationProvider2 |
generateActionState, generateAssociationRole, generateStateBody |
Methods inherited from interface org.argouml.application.api.ArgoModule |
getModuleAuthor, getModuleDescription, getModuleKey, getModuleName, getModuleVersion |
Field Detail |
private NotationName notationName
public static final String INDENT
private static Map generators
Constructor Detail |
public Generator2(NotationName name)
name
- The name.Method Detail |
public static Generator2 getGenerator(NotationName n)
n
- The name.
public NotationName getNotation()
getNotation
in interface NotationProvider2
NotationProvider2.getNotation()
public String generate(Object o)
o
- the element to be generated
public abstract String generateExtensionPoint(Object op)
NotationProvider2
generateExtensionPoint
in interface NotationProvider2
op
- Object to generate representation for.
NotationProvider2.generateExtensionPoint(Object)
public abstract String generateOperation(Object op, boolean documented)
NotationProvider2
generateOperation
in interface NotationProvider2
op
- Object to generate representation for.documented
- true
if documentation shall be generated.
NotationProvider2.generateOperation(Object, boolean)
public abstract String generateAttribute(Object attr, boolean documented)
NotationProvider2
generateAttribute
in interface NotationProvider2
attr
- Object to generate representation for.documented
- true
if documentation shall be generated.
NotationProvider2.generateAttribute(Object, boolean)
public abstract String generateParameter(Object param)
NotationProvider2
generateParameter
in interface NotationProvider2
param
- Object to generate representation for.
NotationProvider2.generateParameter(Object)
public abstract String generatePackage(Object p)
NotationProvider2
generatePackage
in interface NotationProvider2
p
- Object to generate representation for.
NotationProvider2.generatePackage(Object)
public abstract String generateClassifier(Object cls)
NotationProvider2
generateClassifier
in interface NotationProvider2
cls
- Object to generate representation for.
NotationProvider2.generateClassifier(Object)
public abstract String generateTaggedValue(Object s)
NotationProvider2
generateTaggedValue
in interface NotationProvider2
s
- Object to generate representation for.
NotationProvider2.generateTaggedValue(Object)
public abstract String generateAssociation(Object a)
NotationProvider2
generateAssociation
in interface NotationProvider2
a
- Object to generate representation for.
NotationProvider2.generateAssociation(Object)
public abstract String generateAssociationEnd(Object ae)
NotationProvider2
generateAssociationEnd
in interface NotationProvider2
ae
- Object to generate representation for.
NotationProvider2.generateAssociationEnd(Object)
public abstract String generateMultiplicity(Object m)
NotationProvider2
generateMultiplicity
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateMultiplicity(Object)
public abstract String generateObjectFlowState(Object m)
NotationProvider2
generateObjectFlowState
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateObjectFlowState(Object)
public abstract String generateState(Object m)
NotationProvider2
generateState
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateState(Object)
public abstract String generateSubmachine(Object m)
NotationProvider2
generateSubmachine
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateSubmachine(Object)
public abstract String generateTransition(Object m)
NotationProvider2
generateTransition
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateTransition(Object)
public abstract String generateAction(Object m)
NotationProvider2
generateAction
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateAction(Object)
public abstract String generateGuard(Object m)
NotationProvider2
generateGuard
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateGuard(Object)
public abstract String generateMessage(Object m)
NotationProvider2
generateMessage
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateMessage(Object)
public abstract String generateEvent(Object m)
NotationProvider2
generateEvent
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateEvent(Object)
public abstract String generateVisibility(Object m)
NotationProvider2
generateVisibility
in interface NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateVisibility(Object)
public String generateExpression(Object expr)
NotationProvider2
generateExpression
in interface NotationProvider2
expr
- Object to generate representation for.
NotationProvider2.generateExpression(Object)
public String generateName(String n)
NotationProvider2
TODO: What is the purpose of this function? Is it really needed?
generateName
in interface NotationProvider2
n
- The String to be converted.
NotationProvider2.generateName(String)
public String generateUninterpreted(String un)
What is the purpose of this function? Shouldn't it be private static?
un
- The String.
public String generateClassifierRef(Object cls)
NotationProvider2
generateClassifierRef
in interface NotationProvider2
cls
- Object to generate representation for.
NotationProvider2.generateClassifierRef(Object)
public String generateStereotype(Object st)
NotationProvider2
generateStereotype
in interface NotationProvider2
st
- Object to generate representation for.
This can also be a Collection with all stereotypes.
NotationProvider2.generateStereotype(Object)
public Vector getModulePopUpActions(Vector v, Object o)
ArgoModule
getModulePopUpActions
in interface ArgoModule
v
- Vector of actionso
- which the actions are valid for
ArgoModule.getModulePopUpActions(
Vector, Object)
public boolean shutdownModule()
ArgoModule
shutdownModule
in interface ArgoModule
ArgoModule.shutdownModule()
public boolean initializeModule()
ArgoModule
initializeModule
in interface ArgoModule
ArgoModule.initializeModule()
public void setModuleEnabled(boolean enabled)
ArgoModule
setModuleEnabled
in interface ArgoModule
enabled
- true to enable module, false to disableArgoModule.setModuleEnabled(boolean)
public boolean inContext(Object[] o)
Pluggable
inContext
in interface Pluggable
o
- 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.
Pluggable.inContext(Object[])
public static String getCodePath(Object me)
If empty or not existing return null.
me
- The model element
public boolean isModuleEnabled()
isModuleEnabled
in interface ArgoModule
ArgoModule.isModuleEnabled()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |