org.argouml.uml
Class DocumentationManager

java.lang.Object
  extended byorg.argouml.uml.DocumentationManager

public class DocumentationManager
extends Object

This class handles the Documentation of ModelElements. Documentation is represented internally by the tagged value "documentation", but it has its own tab-panel to ease user handling.


Field Summary
private static String LINE_SEPARATOR
          The system's native line-ends, for when things are written to file.
 
Constructor Summary
DocumentationManager()
           
 
Method Summary
private static int appendComment(StringBuffer sb, String prefix, String comment, int nlprefix)
          Append a string to sb which is chopped into lines and each line prefixed with prefix.
static String defaultFor(Object o, String indent)
          Generate default documentation.
static String getComments(Object o)
          Get the comments (the notes in a diagram) for a modelelement.
static String getComments(Object o, String header, String prefix, String footer)
          Get the comments (the notes in a diagram) for a modelelement.
static String getDocs(Object o, String indent)
          This function returns the documentation in C-style comment format.
static String getDocs(Object o, String indent, String header, String prefix, String footer)
           
static boolean hasDocs(Object o)
          Determine whether documentation is associated with the given element or not.
static void setDocs(Object o, String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

private static final String LINE_SEPARATOR
The system's native line-ends, for when things are written to file.

Constructor Detail

DocumentationManager

public DocumentationManager()
Method Detail

getDocs

public static String getDocs(Object o,
                             String indent)
This function returns the documentation in C-style comment format.

Parameters:
o - the ModelElement
indent - the current indentation for new lines
Returns:
the documentation, as a String

getDocs

public static String getDocs(Object o,
                             String indent,
                             String header,
                             String prefix,
                             String footer)
Parameters:
o - the ModelElement
indent - the current indentation for new lines
header - is the first line
prefix - is inserted at every line before the doc
footer - is the closing line
Returns:
the string that represents the documentation for the given ModelElement

setDocs

public static void setDocs(Object o,
                           String s)
Parameters:
o - the ModelElement. If it is not a ModelElement, then you'll get a IllegalArgumentException
s - the string representing the documentation

hasDocs

public static boolean hasDocs(Object o)
Determine whether documentation is associated with the given element or not. Added 2001-10-05 STEFFEN ZSCHALER for use by org.argouml.language.java.generator.CodeGenerator

Parameters:
o - The given element.
Returns:
true if the given element has docs.

defaultFor

public static String defaultFor(Object o,
                                String indent)
Generate default documentation.

Parameters:
o - the ModelElement
indent - the current indentation string for new lines
Returns:
the default documentation

getComments

public static String getComments(Object o)
Get the comments (the notes in a diagram) for a modelelement.

This returns a c-style comments.

Parameters:
o - The modelelement.
Returns:
a String.

getComments

public static String getComments(Object o,
                                 String header,
                                 String prefix,
                                 String footer)
Get the comments (the notes in a diagram) for a modelelement.

Parameters:
o - The given modelelement.
header - is the comment header.
prefix - is the comment prefix (on every line).
footer - is the comment footer.
Returns:
a string with the comments.

appendComment

private static int appendComment(StringBuffer sb,
                                 String prefix,
                                 String comment,
                                 int nlprefix)
Append a string to sb which is chopped into lines and each line prefixed with prefix.

Parameters:
sb - the StringBuffer to append to.
prefix - the prefix to each line.
comment - the text to reformat.
nlprefix - the number of empty lines to prefix the comment with.
Returns:
the number of pending empty lines.


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