).
- public abstract class Generator2
- extends Object
- implements PluggableNotation
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.
- Since:
- 0.15.6
|
Field Summary |
static String |
INDENT
Deprecated. Two spaces used for indenting code in classes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INDENT
public static final String INDENT
- Deprecated.
- Two spaces used for indenting code in classes.
- See Also:
- Constant Field Values
Generator2
public Generator2(NotationName nn)
- Deprecated.
- Constructor that sets the name of this notation.
- Parameters:
nn - The NotationName object.
getGenerator
public static Generator2 getGenerator(NotationName n)
- Deprecated.
- Access method that finds the correct generator based on a name.
- Parameters:
n - The name.
- Returns:
- a generator (or null if not found).
getNotation
public NotationName getNotation()
- Deprecated.
- See Also:
NotationProvider2#getNotation()
generate
public String generate(Object o)
- Deprecated.
- 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
generateActionState
public abstract String generateActionState(Object actionState)
- Deprecated.
generateExtensionPoint
public abstract String generateExtensionPoint(Object op)
- Deprecated.
generateOperation
public abstract String generateOperation(Object op,
boolean documented)
- Deprecated.
generateAttribute
public abstract String generateAttribute(Object attr,
boolean documented)
- Deprecated.
generateParameter
public abstract String generateParameter(Object param)
- Deprecated.
generatePackage
public abstract String generatePackage(Object p)
- Deprecated.
generateClassifier
public abstract String generateClassifier(Object cls)
- Deprecated.
generateTaggedValue
public abstract String generateTaggedValue(Object s)
- Deprecated.
generateAssociation
public abstract String generateAssociation(Object a)
- Deprecated.
generateAssociationEnd
public abstract String generateAssociationEnd(Object ae)
- Deprecated.
generateMultiplicity
public abstract String generateMultiplicity(Object m)
- Deprecated.
generateObjectFlowState
public abstract String generateObjectFlowState(Object m)
- Deprecated.
generateState
public abstract String generateState(Object m)
- Deprecated.
generateSubmachine
public abstract String generateSubmachine(Object m)
- Deprecated.
generateTransition
public abstract String generateTransition(Object m)
- Deprecated.
generateAction
public abstract String generateAction(Object m)
- Deprecated.
generateGuard
public abstract String generateGuard(Object m)
- Deprecated.
generateMessage
public abstract String generateMessage(Object m)
- Deprecated.
generateEvent
public abstract String generateEvent(Object m)
- Deprecated.
generateVisibility
public abstract String generateVisibility(Object m)
- Deprecated.
generateExpression
public String generateExpression(Object expr)
- Deprecated.
generateName
public String generateName(String n)
- Deprecated.
generateUninterpreted
public String generateUninterpreted(String un)
- Deprecated.
- Make a string non-null.
What is the purpose of this function? Shouldn't it be private static?
- Parameters:
un - The String.
- Returns:
- a non-null string.
generateClassifierRef
public String generateClassifierRef(Object cls)
- Deprecated.
generateStereotype
public String generateStereotype(Object st)
- Deprecated.
getModulePopUpActions
public Vector getModulePopUpActions(Vector v,
Object o)
- Deprecated.
- Description copied from interface:
ArgoModule
- Calls all modules to let them add to a popup menu.
- Specified by:
getModulePopUpActions in interface ArgoModule
- Parameters:
v - Vector of actionso - which the actions are valid for
- Returns:
- Vector containing pop-up actions
- See Also:
ArgoModule.getModulePopUpActions(
Vector, Object)
shutdownModule
public boolean shutdownModule()
- Deprecated.
- Description copied from interface:
ArgoModule
- Method called when Argo is unloading a module.
- Specified by:
shutdownModule in interface ArgoModule
- Returns:
- true if the module terminated properly.
- See Also:
ArgoModule.shutdownModule()
initializeModule
public boolean initializeModule()
- Deprecated.
- Description copied from interface:
ArgoModule
- Method called when Argo is loading a module.
- Specified by:
initializeModule in interface ArgoModule
- Returns:
- true if the module initialized properly.
- See Also:
ArgoModule.initializeModule()
setModuleEnabled
public void setModuleEnabled(boolean enabled)
- Deprecated.
- Description copied from interface:
ArgoModule
- Called to enable or disable a module programmatically.
- Specified by:
setModuleEnabled in interface ArgoModule
- Parameters:
enabled - true to enable module, false to disable- See Also:
ArgoModule.setModuleEnabled(boolean)
inContext
public boolean inContext(Object[] o)
- Deprecated.
- Description copied from interface:
Pluggable
- A function which allows a plug-in to decide if it is available
under a specific context.
One example of a plugin with multiple criteria is the PluggableMenu.
PluggableMenu requires the first context to be a JMenuItem
which wants the PluggableMenu attached to as the context,
so that it can determine that it would attach to a menu. The
second context is an internal (non-localized) description
of the menu such as "File" or "View"
so that the plugin can further decide.
- Specified by:
inContext in interface Pluggable
- Parameters:
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.
- Returns:
- True if the plug-in wants to make itself available
for this context, otherwise false.
- See Also:
Pluggable.inContext(Object[])
getCodePath
public static String getCodePath(Object me)
- Deprecated.
- Gets the path of the code base for a model element.
If empty or not existing return null.
- Parameters:
me - The model element
- Returns:
- String representation of "src_path" tagged value.
isModuleEnabled
public boolean isModuleEnabled()
- Deprecated.
- The default for any Generator is to be enabled.
- Specified by:
isModuleEnabled in interface ArgoModule
- Returns:
- that this module is enabled.
- See Also:
ArgoModule.isModuleEnabled()