org.nakedobjects.utility
Class ComponentLoader
java.lang.Object
org.nakedobjects.utility.ComponentLoader
- public class ComponentLoader
- extends java.lang.Object
Method Summary |
static java.lang.Object |
loadComponent(java.lang.String paramName,
java.lang.Class requiredClass)
Loads a component required by the system, as specfied in the
configuration file. |
static java.lang.Object |
loadComponent(java.lang.String paramName,
java.lang.String defaultType,
java.lang.Class requiredClass)
Loads a component required by the system, as specfied in the
configuration file. |
static java.lang.Object |
loadComponentIfRequired(java.lang.String paramName,
java.lang.Class requiredClass)
|
static java.lang.Object |
loadComponentIfRequired(java.lang.String paramName,
java.lang.String defaultType,
java.lang.Class requiredClass)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentLoader
public ComponentLoader()
loadComponent
public static java.lang.Object loadComponent(java.lang.String paramName,
java.lang.Class requiredClass)
throws ConfigurationException
- Loads a component required by the system, as specfied in the
configuration file. If there is no class specified in the configuration
file then the default class is used.
- Parameters:
paramName
- the parameter name to match with the configuration filerequiredClass
- the type of component that must be specified
- Returns:
- Object the loaded component
- Throws:
ConfigurationException
- thrown if there is no component
specified, the class cannot be found, the class is of the wrong type, or
there is a problem loading or accessing it.
loadComponentIfRequired
public static java.lang.Object loadComponentIfRequired(java.lang.String paramName,
java.lang.Class requiredClass)
throws ConfigurationException
- Throws:
ConfigurationException
loadComponent
public static java.lang.Object loadComponent(java.lang.String paramName,
java.lang.String defaultType,
java.lang.Class requiredClass)
throws ConfigurationException
- Loads a component required by the system, as specfied in the
configuration file. If there is no class specified in the configuration
file then the default class is used.
- Parameters:
paramName
- the parameter name to match with the configuration filedefaultType
- the name of the class to use for the default
componentrequiredClass
- the type of component that must be specified
- Returns:
- Object the loaded component
- Throws:
ConfigurationException
- thrown if there is no component
specified, the class cannot be found, the class is of the wrong type, or
there is a problem loading or accessing it.
loadComponentIfRequired
public static java.lang.Object loadComponentIfRequired(java.lang.String paramName,
java.lang.String defaultType,
java.lang.Class requiredClass)
throws ConfigurationException
- Throws:
ConfigurationException