Package net.sf.basedb.core
Class PluginParameter<T>
- java.lang.Object
-
- net.sf.basedb.core.PluginParameter<T>
-
- Direct Known Subclasses:
NamespacePluginParameter
public class PluginParameter<T> extends Object
Contains information about a single parameter that the plugin needs for a request.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
RequestInformation
,PluginRequest
- Last modified
- $Date$
-
-
Field Summary
Fields Modifier and Type Field Description private T
defaultValue
A default value that overrides the default set by the parameter type.private String
description
A longer help text explaining what the particular parameter is needed for.boolean
hidden
If the parameter should be hidden from user input or not.private String
label
A short label used by the client application as in the GUI.private String
name
The name of the parameter that the plugin use to identify the value with.private ParameterType<T>
type
Information of the parameter type.
-
Constructor Summary
Constructors Constructor Description PluginParameter(String name, String label, String description, ParameterType<T> type)
Constructor that sets all members except the default value.PluginParameter(String name, String label, String description, T defaultValue, ParameterType<T> type)
Constructor that sets all members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getDefaultValue()
Get the default value for this parameter or null if no default has been specifiedString
getDescription()
Get a description of the parameter.String
getLabel()
Get the label of the parameter.String
getName()
Get the parameter name.ParameterType<T>
getParameterType()
Get the parameter type, which tells the client application the data type and allowed values for the parameter.boolean
isHidden()
Check if the parameter is a hidden parameter or not.String
toString()
-
-
-
Field Detail
-
hidden
public final boolean hidden
If the parameter should be hidden from user input or not. The parameter value will then be the default value.
-
name
private final String name
The name of the parameter that the plugin use to identify the value with.
-
label
private final String label
A short label used by the client application as in the GUI.
-
description
private final String description
A longer help text explaining what the particular parameter is needed for.
-
defaultValue
private final T defaultValue
A default value that overrides the default set by the parameter type.
-
type
private final ParameterType<T> type
Information of the parameter type.
-
-
Constructor Detail
-
PluginParameter
public PluginParameter(String name, String label, String description, ParameterType<T> type)
Constructor that sets all members except the default value. The default value is taken from the parameter types default value.- Parameters:
name
- The name of the parameter, null is allowed for section headerslabel
- Label that can be used in the GUI for the parameter, or null to create a hidden parameterdescription
- A help text explaining what the parameter is used fortype
- The parameter type, or null to create a section header
-
PluginParameter
public PluginParameter(String name, String label, String description, T defaultValue, ParameterType<T> type)
Constructor that sets all members. If a default value is specified it override the default value specified by the paramter type.- Parameters:
name
- The name of the parameter, null is allowed for section headerslabel
- Label that can be used in the GUI for the parameter, or null to create a hidden parameterdescription
- A help text explaining what the parameter is used fordefaultValue
- The default value of the parameter or null to use the default set by the parameter typetype
- The parameter type, or null to create a section header
-
-
Method Detail
-
isHidden
public boolean isHidden()
Check if the parameter is a hidden parameter or not. A hidden parameter should not be displayed for the user. The value should be set to the parameter types default value, ie.getParmeterType().getDefaultValue()
- Returns:
- TRUE if the parameter is hidden, FALSE otherwise
-
getName
public String getName()
Get the parameter name. This is the name of the parameter that the plugin use to identify the value with. This is the name the client application should use when callingPluginRequest.setParameterValue(String, Object)
.- Returns:
- The name
-
getLabel
public String getLabel()
Get the label of the parameter. The label is a short string that a client application should display in the GUI.- Returns:
- The label
-
getDescription
public String getDescription()
Get a description of the parameter. The description may be a longer help text explaining why the parameter is needed and what it is for.- Returns:
- The label
-
getDefaultValue
public T getDefaultValue()
Get the default value for this parameter or null if no default has been specified- Returns:
- The default value
-
getParameterType
public ParameterType<T> getParameterType()
Get the parameter type, which tells the client application the data type and allowed values for the parameter.- Returns:
- A
ParameterType
object
-
-