org.argouml.moduleloader
Class ModuleLoader2

java.lang.Object
  extended byorg.argouml.moduleloader.ModuleLoader2

public final class ModuleLoader2
extends Object

This is the module loader that loads modules implementing the ModuleInterface.

This is a singleton. There are convenience functions that are static to access the module.

Since:
0.15.4

Field Summary
static String CLASS_SUFFIX
          Class file suffix.
 
Method Summary
static void addClass(String classname)
          Add a class from the current class loader.
static Collection allModules()
          Get a Collection with all the names.
static void doLoad(boolean failingAllowed)
          Enables all selected modules and disabling all modules not selected.
static String getDescription(String name)
          Create a description of the module based on the information provided by the module itself.
static ModuleLoader2 getInstance()
          Get hold of the instance of this object.
static boolean isEnabled(String name)
          Gets the loaded status for some other module.
static boolean isSelected(String name)
          Get the selected.
static SortedMap notYetLoadedModules()
          Get a list of not yet loaded modules.
static void setSelected(String name, boolean value)
          Set the selected value.
 void setSelectedInternal(String name, boolean value)
          Set the selected value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_SUFFIX

public static final String CLASS_SUFFIX
Class file suffix.

See Also:
Constant Field Values
Method Detail

getInstance

public static ModuleLoader2 getInstance()
Get hold of the instance of this object.

Returns:
the instance

doLoad

public static void doLoad(boolean failingAllowed)
Enables all selected modules and disabling all modules not selected.

In short this attempts to make the modules obey their selection.

Parameters:
failingAllowed - is true if enabling or disabling of some of the modules is allowed to fail.

isEnabled

public static boolean isEnabled(String name)
Gets the loaded status for some other module.

Parameters:
name - is the module name of the queried module
Returns:
true if the module exists and is enabled.

allModules

public static Collection allModules()
Get a Collection with all the names.

Returns:
all the names.

isSelected

public static boolean isSelected(String name)
Get the selected.

Parameters:
name - The name of the module.
Returns:
true if the module is selected.

setSelected

public static void setSelected(String name,
                               boolean value)
Set the selected value.

Parameters:
name - The name of the module.
value - Selected or not.

setSelectedInternal

public void setSelectedInternal(String name,
                                boolean value)
Set the selected value.

Parameters:
name - The name of the module.
value - Selected or not.
See Also:
setSelected(String, boolean)

getDescription

public static String getDescription(String name)
Create a description of the module based on the information provided by the module itself.

Parameters:
name - The name of the module.
Returns:
The description.

notYetLoadedModules

public static SortedMap notYetLoadedModules()
Get a list of not yet loaded modules.

TODO: For the moment these modules are hardcoded into this file. Eventually they will be available in some config file.

Returns:
a SortedMap from name (String) to classname String.

addClass

public static void addClass(String classname)
                     throws ClassNotFoundException
Add a class from the current class loader.

Parameters:
classname - The name of the class (including package).
Throws:
ClassNotFoundException - if the class classname is not found.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook