org.argouml.uml.generator
Class GeneratorHelper

java.lang.Object
  extended by org.argouml.uml.generator.GeneratorHelper

public final class GeneratorHelper
extends java.lang.Object

Provides some utility methods for code generation.


Method Summary
static java.util.Collection generate(Language lang, java.util.Collection elements, boolean deps)
          Generate code for one or more elements in a given language.
static java.util.Collection generate(Language lang, java.lang.Object elem, boolean deps)
          Generate code for a single element.
static Language makeLanguage(java.lang.String theName)
          Creates a language with title equal to the name and no icon.
static Language makeLanguage(java.lang.String theName, javax.swing.Icon theIcon)
          Creates a language with title equal to the name.
static Language makeLanguage(java.lang.String theName, java.lang.String theTitle)
          Creates a language with no icon.
static Language makeLanguage(java.lang.String theName, java.lang.String theTitle, javax.swing.Icon theIcon)
          Creates a new Language only if one with the same name doesn't already exist in GeneratorManager, in which case that one is returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generate

public static java.util.Collection generate(Language lang,
                                            java.util.Collection elements,
                                            boolean deps)
Generate code for one or more elements in a given language.

Parameters:
lang - The language to use.
elements - The elements to generate code for.
deps - Whether to generate dependency too.
Returns:
A collection of SourceUnit objects. The collection may be empty if no file is generated.

generate

public static java.util.Collection generate(Language lang,
                                            java.lang.Object elem,
                                            boolean deps)
Generate code for a single element.

Parameters:
lang - The language to use.
elem - The element to generate code for.
deps - Whether to generate dependency too.
Returns:
A collection of SourceUnit objects. The collection may be empty if no file is generated.

makeLanguage

public static Language makeLanguage(java.lang.String theName,
                                    java.lang.String theTitle,
                                    javax.swing.Icon theIcon)
Creates a new Language only if one with the same name doesn't already exist in GeneratorManager, in which case that one is returned.

Parameters:
theName - The name of the language.
theTitle - A string representing the language for display.
theIcon - An icon for the language.
Returns:
The Language object found or created.

makeLanguage

public static Language makeLanguage(java.lang.String theName,
                                    java.lang.String theTitle)
Creates a language with no icon.

Parameters:
theName - The name of the language.
theTitle - A string representing the language for display.
Returns:
The Language object found or created.
See Also:
makeLanguage(String, String, Icon)

makeLanguage

public static Language makeLanguage(java.lang.String theName,
                                    javax.swing.Icon theIcon)
Creates a language with title equal to the name.

Parameters:
theName - The name of the language.
theIcon - An icon for the language.
Returns:
The Language object found or created.
See Also:
makeLanguage(String, String, Icon)

makeLanguage

public static Language makeLanguage(java.lang.String theName)
Creates a language with title equal to the name and no icon.

Parameters:
theName - The name of the language.
Returns:
The Language object found or created.
See Also:
makeLanguage(String, String, Icon)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook