|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.uml.generator.Generator2
org.argouml.uml.generator.GeneratorDisplay
Generator2 subclass to generate code for display in diagrams in text fields in the ArgoUML user interface. The generated code looks a lot like (invalid) Java. The idea is that other generators could be written for other languages. This code is just a placeholder for future development, I expect it to be totally replaced.
TODO: always check for null!!!
Nested Class Summary | |
(package private) class |
GeneratorDisplay.MsgPtr
|
Field Summary | |
static String |
ANY_RANGE
ANY_RANGE stands for "0..*". |
private static GeneratorDisplay |
singleton
|
Fields inherited from class org.argouml.uml.generator.Generator2 |
INDENT |
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 | |
private |
GeneratorDisplay()
The constructor. |
Method Summary | |
(package private) int |
countSuccessors(Object m)
|
String |
generateAction(Object m)
Generate the String representation for an Action. |
String |
generateActionState(Object actionState)
Generate the String representation for an Action State. |
String |
generateAssociation(Object a)
Generate the String representation for an Association. |
String |
generateAssociationEnd(Object ae)
Generate the String representation for an AssociationEnd. |
String |
generateAssociationFrom(Object a,
Object ae)
|
String |
generateAssociationRole(Object assocRole)
generate the name of an association role of the form: / name : name of the base association. |
String |
generateAttribute(Object attr,
boolean documented)
Generates a string representation for the provided attribute. |
String |
generateChangability(Object sf)
|
String |
generateClassifier(Object cls)
Generate the String representation for a Classifier. |
String |
generateClassList(Collection classifiers)
|
String |
generateConstraint(Object c)
|
String |
generateConstraints(Object me)
|
String |
generateEvent(Object m)
Generates the text for a (trigger) event. |
String |
generateExtensionPoint(Object ep)
Generate the display for an extension point. |
private String |
generateGeneralization(Collection generalizations,
boolean impl)
|
String |
generateGuard(Object m)
Generate the String representation for a Guard. |
private String |
generateKind(Object kind)
|
String |
generateMessage(Object m)
Generates a textual description for a MMessage m. |
String |
generateMessageNumber(Object m)
Generates the textual number of MMessage m. |
private String |
generateMessageNumber(Object m,
Object pre,
int position)
|
String |
generateMultiplicity(Object m)
Generate the String representation for an Multiplicity. |
protected String |
generateMultiplicityRange(Object mr)
Generates a multiplicity range. |
String |
generateObjectFlowState(Object m)
Generate the String representation for a ObjectFlowState. |
String |
generateOperation(Object op,
boolean documented)
Generates an operation according to the UML 1.3 notation: stereotype visibility name (parameter-list) : return-type-expression {property-string} For the return-type-expression: only the types of the return parameters are shown. |
String |
generatePackage(Object p)
Generate the String representation for a Package. |
String |
generateParameter(Object parameter)
Generates the representation of a parameter on the display (diagram). |
private String |
generateParameterList(Object parameterListOwner)
Generates a list of parameters. |
String |
generateRecurrence(Object expr)
Generates a textual description of a MIterationExpression. |
String |
generateScope(Object f)
|
String |
generateState(Object m)
Generate the String representation for a State. |
String |
generateStateBody(Object m)
Generate the String representation for a StateBody. |
String |
generateSubmachine(Object m)
Generate the String representation for a Submachine. |
String |
generateTaggedValue(Object tv)
Generate the String representation for a TaggedValue. |
String |
generateTransition(Object m)
Generate the String representation for a Transition. |
String |
generateVisibility(Object o)
Returns a visibility String eihter for a MVisibilityKind (according to the definition in NotationProvider2), but also for a model element. |
static GeneratorDisplay |
getInstance()
|
String |
getModuleAuthor()
The module author. |
String |
getModuleDescription()
Textual description of the module. |
String |
getModuleKey()
The module identifying key. |
String |
getModuleName()
Display name of the module. |
String |
getModuleVersion()
The module version. |
boolean |
inContext(Object[] o)
A function which allows a plug-in to decide if it is available under a specific context. |
boolean |
isModuleEnabled()
The default for any Generator is to be enabled. |
(package private) int |
recCountPredecessors(Object message,
GeneratorDisplay.MsgPtr ptr)
|
Methods inherited from class org.argouml.uml.generator.Generator2 |
generate, generateClassifierRef, generateExpression, generateName, generateStereotype, generateUninterpreted, getCodePath, getGenerator, getModulePopUpActions, getNotation, initializeModule, setModuleEnabled, shutdownModule |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static GeneratorDisplay singleton
public static final String ANY_RANGE
ANY_RANGE
stands for "0..*".
Constructor Detail |
private GeneratorDisplay()
Method Detail |
public static GeneratorDisplay getInstance()
public String generateExtensionPoint(Object ep)
The representation is "name: location". "name: " is omitted if there is no name given.
generateExtensionPoint
in interface NotationProvider2
generateExtensionPoint
in class Generator2
ep
- The extension point.
NotationProvider2.generateExtensionPoint(Object)
public String generateOperation(Object op, boolean documented)
generateOperation
in interface NotationProvider2
generateOperation
in class Generator2
NotationProvider2.generateOperation(
Object, boolean)
public String generateAttribute(Object attr, boolean documented)
generateAttribute
in interface NotationProvider2
generateAttribute
in class Generator2
NotationProvider2.generateAttribute(
Object, boolean)
public String generateParameter(Object parameter)
kind name : type-expression = default-value
generateParameter
in interface NotationProvider2
generateParameter
in class Generator2
NotationProvider2.generateParameter(java.lang.Object)
public String generatePackage(Object p)
NotationProvider2
generatePackage
in interface NotationProvider2
generatePackage
in class Generator2
NotationProvider2.generatePackage(java.lang.Object)
public String generateClassifier(Object cls)
NotationProvider2
generateClassifier
in interface NotationProvider2
generateClassifier
in class Generator2
NotationProvider2.generateClassifier(java.lang.Object)
public String generateTaggedValue(Object tv)
NotationProvider2
generateTaggedValue
in interface NotationProvider2
generateTaggedValue
in class Generator2
NotationProvider2.generateTaggedValue(java.lang.Object)
public String generateMessageNumber(Object m)
If you plan to modify this number, make sure that ParserDisplay.parseMessage is adapted to the change.
m
- A Message to generate the number for.
private String generateKind(Object kind)
private String generateMessageNumber(Object m, Object pre, int position)
int recCountPredecessors(Object message, GeneratorDisplay.MsgPtr ptr)
int countSuccessors(Object m)
public String generateRecurrence(Object expr)
expr
- the given expression
public String generateMessage(Object m)
generateMessage
in interface NotationProvider2
generateMessage
in class Generator2
m
- A MMessage to generate a description for.
NotationProvider2.generateMessage(Object)
public String generateAssociationFrom(Object a, Object ae)
a
- the associationae
- the associationend
public String generateAssociation(Object a)
NotationProvider2
generateAssociation
in interface NotationProvider2
generateAssociation
in class Generator2
NotationProvider2.generateAssociation(java.lang.Object)
public String generateAssociationEnd(Object ae)
NotationProvider2
generateAssociationEnd
in interface NotationProvider2
generateAssociationEnd
in class Generator2
NotationProvider2.generateAssociationEnd(java.lang.Object)
public String generateConstraints(Object me)
me
- the given ModelElement
public String generateConstraint(Object c)
c
- the given constraint
public String generateAssociationRole(Object assocRole)
assocRole
- the given associationrole
NotationProvider2.generateAssociationRole(java.lang.Object)
private String generateGeneralization(Collection generalizations, boolean impl)
generalizations
- the given collection of generalizationsimpl
-
public String generateClassList(Collection classifiers)
classifiers
- the given collection of classifiers
public String generateVisibility(Object o)
generateVisibility
in interface NotationProvider2
generateVisibility
in class Generator2
NotationProvider2.generateVisibility(java.lang.Object)
public String generateScope(Object f)
f
- the given feature
public String generateChangability(Object sf)
sf
- the given structural feature
public String generateMultiplicity(Object m)
NotationProvider2
generateMultiplicity
in interface NotationProvider2
generateMultiplicity
in class Generator2
NotationProvider2.generateMultiplicity(
Object)
protected String generateMultiplicityRange(Object mr)
mr
- the given MultiplicityRange object
public String generateState(Object m)
NotationProvider2
generateState
in interface NotationProvider2
generateState
in class Generator2
NotationProvider2.generateState(java.lang.Object)
public String generateSubmachine(Object m)
NotationProvider2
generateSubmachine
in interface NotationProvider2
generateSubmachine
in class Generator2
NotationProvider2.generateSubmachine(java.lang.Object)
public String generateObjectFlowState(Object m)
NotationProvider2
generateObjectFlowState
in interface NotationProvider2
generateObjectFlowState
in class Generator2
NotationProvider2.generateObjectFlowState(java.lang.Object)
public String generateStateBody(Object m)
NotationProvider2
m
- Object to generate representation for.
NotationProvider2.generateStateBody(java.lang.Object)
public String generateTransition(Object m)
NotationProvider2
generateTransition
in interface NotationProvider2
generateTransition
in class Generator2
NotationProvider2.generateTransition(java.lang.Object)
public String generateAction(Object m)
NotationProvider2
generateAction
in interface NotationProvider2
generateAction
in class Generator2
NotationProvider2.generateAction(java.lang.Object)
public String generateGuard(Object m)
NotationProvider2
generateGuard
in interface NotationProvider2
generateGuard
in class Generator2
NotationProvider2.generateGuard(java.lang.Object)
public String generateEvent(Object m)
generateEvent
in interface NotationProvider2
generateEvent
in class Generator2
m
- Object of any MEvent kind
NotationProvider2.generateEvent(java.lang.Object)
private String generateParameterList(Object parameterListOwner)
(param1, param2, param3, ..., paramN)
If there are no parameters, then "()" is returned.
parameterListOwner
- the 'owner' of the parameters
public String generateActionState(Object actionState)
NotationProvider2
actionState
- Object to generate representation for.
NotationProvider2.generateActionState(java.lang.Object)
public String getModuleName()
ArgoModule
ArgoModule.getModuleName()
public String getModuleDescription()
ArgoModule
ArgoModule.getModuleDescription()
public String getModuleAuthor()
ArgoModule
ArgoModule.getModuleAuthor()
public String getModuleVersion()
ArgoModule
ArgoModule.getModuleVersion()
public String getModuleKey()
ArgoModule
ArgoModule.getModuleKey()
public boolean inContext(Object[] o)
Pluggable
inContext
in interface Pluggable
inContext
in class Generator2
Pluggable.inContext(java.lang.Object[])
public boolean isModuleEnabled()
Generator2
isModuleEnabled
in interface ArgoModule
isModuleEnabled
in class Generator2
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 |