org.argouml.notation.providers.uml
Class NotationUtilityUml

java.lang.Object
  extended by org.argouml.notation.providers.uml.NotationUtilityUml

public final class NotationUtilityUml
extends java.lang.Object

This class is a utility for the UML notation.


Constructor Summary
NotationUtilityUml()
          The constructor.
 
Method Summary
static java.lang.String formatStereotype(java.lang.String name, boolean useGuillemets)
          Create a string representation of a stereotype, keyword or comma separate list of names.
static java.lang.String generateActionSequence(java.lang.Object a)
          Generate a textual representation of the given Action or ActionSequence according the UML standard notation.
static java.lang.String generateMultiplicity(java.lang.Object element, boolean showSingularMultiplicity)
          Generate the text of a multiplicity.
protected static java.lang.String generatePath(java.lang.Object modelElement)
           
static java.lang.String generateStereotype(java.lang.Object st, boolean useGuillemets)
          Generate the text for one or more stereotype(s).
static java.lang.String generateVisibility2(java.lang.Object o)
          Returns a visibility String either for a VisibilityKind or a model element.
 void init()
           
static boolean isValue(java.lang.String key, java.util.Map map)
          Utility function to determine the presence of a key.
protected static void parseModelElement(java.lang.Object me, java.lang.String text)
          Parse a string on the format:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotationUtilityUml

public NotationUtilityUml()
The constructor.

Method Detail

init

public void init()

parseModelElement

protected static void parseModelElement(java.lang.Object me,
                                        java.lang.String text)
                                 throws java.text.ParseException
Parse a string on the format:
     [ << stereotype >>] [+|-|#|~] [full_pathname ::] [name]
 

Parameters:
me - The ModelElement text describes.
text - A String on the above format.
Throws:
java.text.ParseException - when it detects an error in the attribute string. See also ParseError.getErrorOffset().

isValue

public static boolean isValue(java.lang.String key,
                              java.util.Map map)
Utility function to determine the presence of a key. The default is false.

Parameters:
key - the string for the key
map - the Map to check for the presence and value of the key
Returns:
true if the value for the key is true, otherwise false

generateVisibility2

public static java.lang.String generateVisibility2(java.lang.Object o)
Returns a visibility String either for a VisibilityKind or a model element.

Parameters:
o - a modelelement or a visibilitykind
Returns:
a string. May be the empty string, but guaranteed not to be null

generatePath

protected static java.lang.String generatePath(java.lang.Object modelElement)
Parameters:
modelElement - the UML element to generate for
Returns:
a string which represents the path

generateStereotype

public static java.lang.String generateStereotype(java.lang.Object st,
                                                  boolean useGuillemets)
Generate the text for one or more stereotype(s).

Parameters:
st - One of:
  • a stereotype UML object
  • a string
  • a collection of stereotypes
  • a modelelement of which the stereotypes are retrieved
useGuillemets - true if Unicode double angle bracket quote characters should be used.
Returns:
fully formatted string with list of stereotypes separated by commas and surround in brackets

formatStereotype

public static java.lang.String formatStereotype(java.lang.String name,
                                                boolean useGuillemets)
Create a string representation of a stereotype, keyword or comma separate list of names. This method just wraps the string in <> or guillemets (double angle bracket characters) depending on the setting of the flag useGuillemets.

Parameters:
name - the name of the stereotype
useGuillemets - true if Unicode double angle bracket quote characters should be used.
Returns:
the string representation

generateMultiplicity

public static java.lang.String generateMultiplicity(java.lang.Object element,
                                                    boolean showSingularMultiplicity)
Generate the text of a multiplicity.

Parameters:
element - a multiplicity or an element which has a multiplicity
showSingularMultiplicity - if false return the empty string for 1..1 multiplicities.
Returns:
a string containing the formatted multiplicity, or the empty string

generateActionSequence

public static java.lang.String generateActionSequence(java.lang.Object a)
Generate a textual representation of the given Action or ActionSequence according the UML standard notation.

Parameters:
a - the UML Action or ActionSequence
Returns:
the generated textual representation of the given action(sequence). This value is guaranteed NOT null.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook