org.argouml.uml.generator
Class GeneratorDisplay

java.lang.Object
  |
  +--org.argouml.uml.generator.Generator
        |
        +--org.argouml.uml.generator.GeneratorDisplay
All Implemented Interfaces:
ArgoModule, NotationProvider, Pluggable, PluggableNotation

public class GeneratorDisplay
extends Generator
implements PluggableNotation

Generator subclass to generate text for display in diagrams in in text fields in the Argo/UML user interface. The generated code looks a lot like (invalid) Java. The idea is that other generators could be written for outher languages. This code is just a placeholder for future development, I expect it to be totally replaced.


Field Summary
static java.lang.String ANY_RANGE
           
 
Fields inherited from class org.argouml.uml.generator.Generator
INDENT, TEST_SUFFIX
 
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
 
Method Summary
 boolean canParse()
          Can the notation be parsed at all?
 boolean canParse(java.lang.Object o)
          Can the notation be parsed for this object?
static java.lang.String Generate(java.lang.Object o)
           
 java.lang.String generateAction(ru.novosoft.uml.behavior.common_behavior.MAction m)
           
 java.lang.String generateAssociation(ru.novosoft.uml.foundation.core.MAssociation a)
           
 java.lang.String generateAssociationEnd(ru.novosoft.uml.foundation.core.MAssociationEnd ae)
           
 java.lang.String generateAssociationFrom(ru.novosoft.uml.foundation.core.MAssociation a, ru.novosoft.uml.foundation.core.MAssociationEnd ae)
           
 java.lang.String generateAssociationRole(ru.novosoft.uml.behavior.collaborations.MAssociationRole assocRole)
          generate the name of an association role of the form: / name : name of the base association
 java.lang.String generateAttribute(ru.novosoft.uml.foundation.core.MAttribute attr, boolean documented)
          Generates a string representation for the provided attribute.
 java.lang.String generateChangability(ru.novosoft.uml.foundation.core.MStructuralFeature sf)
           
 java.lang.String generateClassifier(ru.novosoft.uml.foundation.core.MClassifier cls)
           
 java.lang.String generateClassList(java.util.Collection classifiers)
           
 java.lang.String generateConstraint(ru.novosoft.uml.foundation.core.MConstraint c)
           
 java.lang.String generateConstraints(ru.novosoft.uml.foundation.core.MModelElement me)
           
 java.lang.String generateExtensionPoint(ru.novosoft.uml.behavior.use_cases.MExtensionPoint ep)
          Generate the display for an extension point. The representation is "name: location".
 java.lang.String generateGeneralization(java.util.Collection generalizations, boolean impl)
           
 java.lang.String generateGuard(ru.novosoft.uml.behavior.state_machines.MGuard m)
           
 java.lang.String generateMessage(ru.novosoft.uml.behavior.collaborations.MMessage m)
          Generates a textual description for a MMessage m.
 java.lang.String generateMessageNumber(ru.novosoft.uml.behavior.collaborations.MMessage m)
          Generates the textual number of MMessage m.
 java.lang.String generateMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity m)
           
protected  java.lang.String generateMultiplicityRange(ru.novosoft.uml.foundation.data_types.MMultiplicityRange mr)
          Generates a multiplicity range.
 java.lang.String generateOperation(ru.novosoft.uml.foundation.core.MOperation op, boolean documented)
          Generates an operation accordin 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.
 java.lang.String generatePackage(ru.novosoft.uml.model_management.MPackage p)
           
 java.lang.String generateParameter(ru.novosoft.uml.foundation.core.MParameter param)
           
 java.lang.String generateRecurrence(ru.novosoft.uml.foundation.data_types.MIterationExpression expr)
          Generates a textual description of a MIterationExpression.
 java.lang.String generateScope(ru.novosoft.uml.foundation.core.MFeature f)
           
 java.lang.String generateState(ru.novosoft.uml.behavior.state_machines.MState m)
           
 java.lang.String generateStateBody(ru.novosoft.uml.behavior.state_machines.MState m)
           
 java.lang.String generateTaggedValue(ru.novosoft.uml.foundation.extension_mechanisms.MTaggedValue tv)
           
 java.lang.String generateTransition(ru.novosoft.uml.behavior.state_machines.MTransition m)
           
 java.lang.String generateVisibility(ru.novosoft.uml.foundation.core.MFeature f)
           
 java.lang.String generateVisibility(ru.novosoft.uml.foundation.data_types.MVisibilityKind vis)
           
static GeneratorDisplay getInstance()
           
 java.lang.String getModuleAuthor()
           
 java.lang.String getModuleDescription()
          Textual description of the module.
 java.lang.String getModuleKey()
           
 java.lang.String getModuleName()
          Display name of the module.
 java.lang.String getModuleVersion()
           
 
Methods inherited from class org.argouml.uml.generator.Generator
generate, generateClassifierRef, generateExpression, generateExpression, generateName, generateStereotype, generateUninterpreted, getCodePath, getGenerator, getModulePopUpActions, getNotation, inContext, initializeModule, isModuleEnabled, isTestModus, setModuleEnabled, setTestModus, shutdownModule
 
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.Pluggable
inContext
 
Methods inherited from interface org.argouml.application.api.ArgoModule
getModulePopUpActions, initializeModule, isModuleEnabled, setModuleEnabled, shutdownModule
 

Field Detail

ANY_RANGE

public static final java.lang.String ANY_RANGE
Method Detail

getInstance

public static GeneratorDisplay getInstance()

Generate

public static java.lang.String Generate(java.lang.Object o)

generateExtensionPoint

public java.lang.String generateExtensionPoint(ru.novosoft.uml.behavior.use_cases.MExtensionPoint ep)

Generate the display for an extension point.

The representation is "name: location". "name :" is omitted if there is no name given.

Overrides:
generateExtensionPoint in class Generator
Parameters:
ep - The extension point.
Returns:
The string representing the extension point.

generateOperation

public java.lang.String generateOperation(ru.novosoft.uml.foundation.core.MOperation op,
                                          boolean documented)
Generates an operation accordin 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. Depending on settings in Notation visibility and properties are shown/not shown.
Overrides:
generateOperation in class Generator
See Also:
NotationProvider.generateOperation(MOperation, boolean)

generateAttribute

public java.lang.String generateAttribute(ru.novosoft.uml.foundation.core.MAttribute attr,
                                          boolean documented)
Generates a string representation for the provided attribute. The string representation will be of the form: visibility name [multiplicity] : type-expression = initial-value {property-string} Depending on settings in Notation visibility, multiplicity, initial value and properties are shown/not shown.
Overrides:
generateAttribute in class Generator
See Also:
NotationProvider.generateAttribute(MAttribute, boolean)

generateParameter

public java.lang.String generateParameter(ru.novosoft.uml.foundation.core.MParameter param)
Overrides:
generateParameter in class Generator

generatePackage

public java.lang.String generatePackage(ru.novosoft.uml.model_management.MPackage p)
Overrides:
generatePackage in class Generator

generateClassifier

public java.lang.String generateClassifier(ru.novosoft.uml.foundation.core.MClassifier cls)
Overrides:
generateClassifier in class Generator

generateTaggedValue

public java.lang.String generateTaggedValue(ru.novosoft.uml.foundation.extension_mechanisms.MTaggedValue tv)
Overrides:
generateTaggedValue in class Generator

generateMessageNumber

public java.lang.String generateMessageNumber(ru.novosoft.uml.behavior.collaborations.MMessage m)
Generates the textual number of MMessage m. The number is a string of numbers separated by points which describes the message's order and level in a collaboration.

If you plan to modify this number, make sure that ParserDisplay.parseMessage is adapted to the change.

Parameters:
m - A MMessage to generate the number for.
Returns:
A String with the message number of m.

generateRecurrence

public java.lang.String generateRecurrence(ru.novosoft.uml.foundation.data_types.MIterationExpression expr)
Generates a textual description of a MIterationExpression.

generateMessage

public java.lang.String generateMessage(ru.novosoft.uml.behavior.collaborations.MMessage m)
Generates a textual description for a MMessage m.
Overrides:
generateMessage in class Generator
Parameters:
m - A MMessage to generate a description for.
Returns:
A String suitable to show in a collaboration diagram.

generateAssociationFrom

public java.lang.String generateAssociationFrom(ru.novosoft.uml.foundation.core.MAssociation a,
                                                ru.novosoft.uml.foundation.core.MAssociationEnd ae)

generateAssociation

public java.lang.String generateAssociation(ru.novosoft.uml.foundation.core.MAssociation a)
Overrides:
generateAssociation in class Generator

generateAssociationEnd

public java.lang.String generateAssociationEnd(ru.novosoft.uml.foundation.core.MAssociationEnd ae)
Overrides:
generateAssociationEnd in class Generator

generateConstraints

public java.lang.String generateConstraints(ru.novosoft.uml.foundation.core.MModelElement me)

generateConstraint

public java.lang.String generateConstraint(ru.novosoft.uml.foundation.core.MConstraint c)

generateAssociationRole

public java.lang.String generateAssociationRole(ru.novosoft.uml.behavior.collaborations.MAssociationRole assocRole)
generate the name of an association role of the form: / name : name of the base association
Returns:
the generated name

generateGeneralization

public java.lang.String generateGeneralization(java.util.Collection generalizations,
                                               boolean impl)

generateClassList

public java.lang.String generateClassList(java.util.Collection classifiers)

generateVisibility

public java.lang.String generateVisibility(ru.novosoft.uml.foundation.data_types.MVisibilityKind vis)

generateVisibility

public java.lang.String generateVisibility(ru.novosoft.uml.foundation.core.MFeature f)

generateScope

public java.lang.String generateScope(ru.novosoft.uml.foundation.core.MFeature f)

generateChangability

public java.lang.String generateChangability(ru.novosoft.uml.foundation.core.MStructuralFeature sf)

generateMultiplicity

public java.lang.String generateMultiplicity(ru.novosoft.uml.foundation.data_types.MMultiplicity m)
Overrides:
generateMultiplicity in class Generator
See Also:
NotationProvider.generateMultiplicity(MMultiplicity)

generateMultiplicityRange

protected java.lang.String generateMultiplicityRange(ru.novosoft.uml.foundation.data_types.MMultiplicityRange mr)
Generates a multiplicity range. The standard getLower and getUpper defined on MMultiplicityRange give a -1 if the multiplicity is n or *. This method circumvents that behaviour.
Parameters:
mr -  
Returns:
String

generateState

public java.lang.String generateState(ru.novosoft.uml.behavior.state_machines.MState m)
Overrides:
generateState in class Generator

generateStateBody

public java.lang.String generateStateBody(ru.novosoft.uml.behavior.state_machines.MState m)

generateTransition

public java.lang.String generateTransition(ru.novosoft.uml.behavior.state_machines.MTransition m)
Overrides:
generateTransition in class Generator

generateAction

public java.lang.String generateAction(ru.novosoft.uml.behavior.common_behavior.MAction m)
Overrides:
generateAction in class Generator

generateGuard

public java.lang.String generateGuard(ru.novosoft.uml.behavior.state_machines.MGuard m)
Overrides:
generateGuard in class Generator

canParse

public boolean canParse()
Description copied from interface: NotationProvider
Can the notation be parsed at all?

canParse

public boolean canParse(java.lang.Object o)
Description copied from interface: NotationProvider
Can the notation be parsed for this object?

getModuleName

public java.lang.String getModuleName()
Description copied from interface: ArgoModule
Display name of the module.
Specified by:
getModuleName in interface ArgoModule

getModuleDescription

public java.lang.String getModuleDescription()
Description copied from interface: ArgoModule
Textual description of the module.
Specified by:
getModuleDescription in interface ArgoModule

getModuleAuthor

public java.lang.String getModuleAuthor()
Specified by:
getModuleAuthor in interface ArgoModule

getModuleVersion

public java.lang.String getModuleVersion()
Specified by:
getModuleVersion in interface ArgoModule

getModuleKey

public java.lang.String getModuleKey()
Specified by:
getModuleKey in interface ArgoModule


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook