org.argouml.language.helpers
Class NotationHelper

java.lang.Object
  extended byorg.argouml.language.helpers.NotationHelper
All Implemented Interfaces:
NotationProvider2

public abstract class NotationHelper
extends Object
implements NotationProvider2

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
           
 
Constructor Summary
NotationHelper(NotationName nn)
          The constructor.
 
Method Summary
 String generate(Object o)
           
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)
           
abstract  String generateClassifier(Object cls)
          Generate the String representation for a Classifier.
 String generateClassifierRef(Object cls)
          Generate the String representation for a ClassifierRef.
 String generateExpression(Object expr)
          Generate the String representation for an Expression.
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 generateOperation(Object op)
           
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 s)
          Generate the String representation for a Stereotype.
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)
           
static String getLeftGuillemot()
           
 NotationName getNotation()
           
static String getRightGuillemot()
           
 
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, generateAttribute, generateEvent, generateExtensionPoint, generateObjectFlowState, generateOperation, generateStateBody, generateSubmachine, generateVisibility
 

Field Detail

notationName

private NotationName notationName
Constructor Detail

NotationHelper

public NotationHelper(NotationName nn)
The constructor.

Parameters:
nn - the notation name
Method Detail

getNotation

public NotationName getNotation()
Specified by:
getNotation in interface NotationProvider2
Returns:
The name of this notation.
See Also:
NotationProvider2.getNotation()

generate

public String generate(Object o)
Parameters:
o - the object to be generated
Returns:
the generated string

generateOperation

public abstract String generateOperation(Object op)
Parameters:
op - the given object
Returns:
the generated string

generateAttribute

public abstract String generateAttribute(Object attr)
Parameters:
attr - the given object
Returns:
the generated string

generateParameter

public abstract String generateParameter(Object param)
Description copied from interface: NotationProvider2
Generate the String representation for a Parameter.

Specified by:
generateParameter in interface NotationProvider2
Parameters:
param - the given object
Returns:
the generated string

generatePackage

public abstract String generatePackage(Object p)
Description copied from interface: NotationProvider2
Generate the String representation for a Package.

Specified by:
generatePackage in interface NotationProvider2
Parameters:
p - the given object
Returns:
the generated string

generateClassifier

public abstract String generateClassifier(Object cls)
Description copied from interface: NotationProvider2
Generate the String representation for a Classifier.

Specified by:
generateClassifier in interface NotationProvider2
Parameters:
cls - the given object
Returns:
the generated string

generateTaggedValue

public abstract String generateTaggedValue(Object s)
Description copied from interface: NotationProvider2
Generate the String representation for a TaggedValue.

Specified by:
generateTaggedValue in interface NotationProvider2
Parameters:
s - the given object
Returns:
the generated string

generateAssociation

public abstract String generateAssociation(Object a)
Description copied from interface: NotationProvider2
Generate the String representation for an Association.

Specified by:
generateAssociation in interface NotationProvider2
Parameters:
a - the given object
Returns:
the generated string

generateAssociationEnd

public abstract String generateAssociationEnd(Object ae)
Description copied from interface: NotationProvider2
Generate the String representation for an AssociationEnd.

Specified by:
generateAssociationEnd in interface NotationProvider2
Parameters:
ae - the given object
Returns:
the generated string

generateMultiplicity

public abstract String generateMultiplicity(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for an Multiplicity.

Specified by:
generateMultiplicity in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

generateState

public abstract String generateState(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for a State.

Specified by:
generateState in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

generateTransition

public abstract String generateTransition(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for a Transition.

Specified by:
generateTransition in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

generateAction

public abstract String generateAction(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for an Action.

Specified by:
generateAction in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

generateGuard

public abstract String generateGuard(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for a Guard.

Specified by:
generateGuard in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

generateMessage

public abstract String generateMessage(Object m)
Description copied from interface: NotationProvider2
Generate the String representation for a Message.

Specified by:
generateMessage in interface NotationProvider2
Parameters:
m - the given object
Returns:
the generated string

getLeftGuillemot

public static String getLeftGuillemot()
Returns:
the left pointing guillemot, i.e. << or the one-character symbol

getRightGuillemot

public static String getRightGuillemot()
Returns:
the right pointing guillemot, i.e. >> or the one-character symbol

generateStereotype

public String generateStereotype(Object s)
Description copied from interface: NotationProvider2
Generate the String representation for a Stereotype.

Specified by:
generateStereotype in interface NotationProvider2
Parameters:
s - the given object
Returns:
the generated string

generateExpression

public String generateExpression(Object expr)
Description copied from interface: NotationProvider2
Generate the String representation for an Expression.

Specified by:
generateExpression in interface NotationProvider2
Parameters:
expr - the given object
Returns:
the generated string

generateName

public String generateName(String n)
Description copied from interface: NotationProvider2
Convert a String to a name.

TODO: What is the purpose of this function? Is it really needed?

Specified by:
generateName in interface NotationProvider2
Parameters:
n - the given object
Returns:
the generated string

generateUninterpreted

public String generateUninterpreted(String un)
Parameters:
un - the given object
Returns:
the generated string

generateClassifierRef

public String generateClassifierRef(Object cls)
Description copied from interface: NotationProvider2
Generate the String representation for a ClassifierRef.

Specified by:
generateClassifierRef in interface NotationProvider2
Parameters:
cls - the given object
Returns:
the generated string


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook