org.argouml.notation.providers.uml
Class OperationNotationUml

java.lang.Object
  extended by org.argouml.notation.NotationProvider
      extended by org.argouml.notation.providers.OperationNotation
          extended by org.argouml.notation.providers.uml.OperationNotationUml

public class OperationNotationUml
extends OperationNotation

The UML notation for an Operation or a Reception.


Constructor Summary
OperationNotationUml(java.lang.Object operation)
          The constructor.
 
Method Summary
 java.lang.String getParsingHelp()
           
 void parse(java.lang.Object modelElement, java.lang.String text)
          Parses the given text, and adapts the modelElement and maybe related elements accordingly.
 void parseOperation(java.lang.String s, java.lang.Object op)
          Parse a line of text and aligns the Operation to the specification given.
 void parseOperationFig(java.lang.Object classifier, java.lang.Object operation, java.lang.String text)
          Parse a string representing one ore more ';' separated operations.
 java.lang.String toString(java.lang.Object modelElement, NotationSettings settings)
          Generate an operation according to the UML notation:
 
Methods inherited from class org.argouml.notation.providers.OperationNotation
initialiseListener, updateListener
 
Methods inherited from class org.argouml.notation.NotationProvider
addElementListener, addElementListener, addElementListener, cleanListener, formatNameList, formatNameList, removeAllElementListeners, removeElementListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationNotationUml

public OperationNotationUml(java.lang.Object operation)
The constructor.

Parameters:
operation - the operation that is represented
Method Detail

parse

public void parse(java.lang.Object modelElement,
                  java.lang.String text)
Description copied from class: NotationProvider
Parses the given text, and adapts the modelElement and maybe related elements accordingly.

Specified by:
parse in class NotationProvider
Parameters:
modelElement - the modelelement to adapt
text - the string given by the user to be parsed to adapt the model

parseOperationFig

public void parseOperationFig(java.lang.Object classifier,
                              java.lang.Object operation,
                              java.lang.String text)
                       throws java.text.ParseException
Parse a string representing one ore more ';' separated operations. The case that a String or char contains a ';' (e.g. in an initializer) is handled, but not other occurences of ';'.

Parameters:
classifier - Classifier The classifier the operation(s) belong to
operation - Operation The operation on which the editing happened
text - The string to parse
Throws:
java.text.ParseException - for invalid input

parseOperation

public void parseOperation(java.lang.String s,
                           java.lang.Object op)
                    throws java.text.ParseException
Parse a line of text and aligns the Operation to the specification given. The line should be on the following form: All elements are optional and, if left unspecified, will preserve their old values.

Stereotypes can be given between any element in the line on the form: <<stereotype1,stereotype2,stereotype3>>

The following properties are recognized to have special meaning: abstract, concurrency, concurrent, guarded, leaf, query, root and sequential.

This syntax is compatible with the UML 1.3 spec.

(formerly visibility name (parameter list) : return-type-expression {property-string} ) (formerly 2nd: [visibility] [keywords] returntype name(params)[;] )

Parameters:
s - The String to parse.
op - The Operation to adjust to the specification in s.
Throws:
java.text.ParseException - when it detects an error in the attribute string. See also ParseError.getErrorOffset().

getParsingHelp

public java.lang.String getParsingHelp()
Specified by:
getParsingHelp in class NotationProvider
Returns:
a i18 key that represents a help string giving an explanation to the user of the syntax

toString

public java.lang.String toString(java.lang.Object modelElement,
                                 NotationSettings settings)
Generate an operation according to the UML 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.

Specified by:
toString in class NotationProvider
Parameters:
modelElement - UML Operation element
settings - notation settings
Returns:
a formatted text string
See Also:
NotationProvider.toString(java.lang.Object, org.argouml.notation.NotationSettings)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook