|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.plugin.NamespaceParameterValuesWrapper
public class NamespaceParameterValuesWrapper
A helper class that wraps a parameter values object with a namespace. All write operations will be made to the specified namespace. Eg, the 'name' parameter is replaced with the namespace + dot + the original name. For example, if namespace="export" and name="toDir", the resulting name is "export.toDir". Read operations will first check the namespace if the parameter exists, otherwise the parameter in the global namespace is used. All other methods simply forward to the parent parameter values object.
The main usage for this class is when a master plug-in needs to use other child plug-ins. By wrapping the parameter values with an instance of this class it makes it possible to store all parameters together without having to worry about name clashes among the children.
NamespacePluginParameter,
NamespaceRequestWrapper| Field Summary | |
|---|---|
private String |
namespace
|
private ParameterValues |
parent
|
| Constructor Summary | |
|---|---|
NamespaceParameterValuesWrapper(ParameterValues parent,
String namespace)
Create a new namespace wrapper for the parent parameter values. |
|
| Method Summary | ||
|---|---|---|
int |
getId()
Get the ID of the job or configuration the parameters comes from. |
|
Job |
getJob()
Get the job that we are executing/configuring. |
|
PluginConfiguration |
getPluginConfiguration()
Get the configuration that we are using/configuring. |
|
PluginDefinition |
getPluginDefinition()
Get the plugin that we are executing/configuring. |
|
Object |
getValue(String name)
Get a single value for a specific parameter. |
|
List<?> |
getValues(String name)
Get a List of values for a specific parameter. |
|
|
setValue(String name,
ParameterType<T> type,
T value)
Set a single value for a parameter. |
|
|
setValues(String name,
ParameterType<T> type,
List<T> values)
Set a list of values for a parameter. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final String namespace
private final ParameterValues parent
| Constructor Detail |
|---|
public NamespaceParameterValuesWrapper(ParameterValues parent,
String namespace)
parent - The parent parameter values, null is not allowednamespace - The namespace, null is not allowed| Method Detail |
|---|
public int getId()
ParameterValues
getId in interface ParameterValuespublic Job getJob()
ParameterValues
getJob in interface ParameterValuespublic PluginConfiguration getPluginConfiguration()
ParameterValues
getPluginConfiguration in interface ParameterValuespublic PluginDefinition getPluginDefinition()
ParameterValues
getPluginDefinition in interface ParameterValues
public Object getValue(String name)
throws PermissionDeniedException,
BaseException
ParameterValuesParameterValues.getValues(String) to return
all values as a list.
getValue in interface ParameterValuesname - the name of the parameter
PermissionDeniedException - If the logged in user doesn't
have permission to read the value
BaseException - If there is another error
public List<?> getValues(String name)
throws PermissionDeniedException,
BaseException
ParameterValuesList of values for a specific parameter.
getValues in interface ParameterValuesname - The name of the parameter
PermissionDeniedException - If the logged in user doesn't
have permission to read the values
BaseException - If there is another error
public <T> void setValue(String name,
ParameterType<T> type,
T value)
throws PermissionDeniedException,
InvalidDataException,
BaseException
ParameterValues
setValue in interface ParameterValuesname - The name of the parametertype - The type of the valuevalue - The value to be set
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the value is invalid according
to the settings in the type
BaseException - If there is another error
public <T> void setValues(String name,
ParameterType<T> type,
List<T> values)
throws PermissionDeniedException,
InvalidDataException,
BaseException
ParameterValues
setValues in interface ParameterValuesname - The name of the parametertype - The type of the valuevalues - A list containing the values
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If any of the values is invalid according
to the settings in the type
BaseException - If there is another error
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||