Package net.sf.basedb.core
Class PluginParameter<T>
java.lang.Object
net.sf.basedb.core.PluginParameter<T>
- Direct Known Subclasses:
NamespacePluginParameter
Contains information about a single parameter that the
plugin needs for a request.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date$
-
Field Summary
Modifier and TypeFieldDescriptionprivate final T
A default value that overrides the default set by the parameter type.private final String
A longer help text explaining what the particular parameter is needed for.final boolean
If the parameter should be hidden from user input or not.private final String
A short label used by the client application as in the GUI.private final String
The name of the parameter that the plugin use to identify the value with.private final ParameterType<T>
Information of the parameter type. -
Constructor Summary
ConstructorDescriptionPluginParameter
(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
Modifier and TypeMethodDescriptionGet the default value for this parameter or null if no default has been specifiedGet a description of the parameter.getLabel()
Get the label of the parameter.getName()
Get the parameter name.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.toString()
-
Field Details
-
name
The name of the parameter that the plugin use to identify the value with. -
label
A short label used by the client application as in the GUI. -
description
A longer help text explaining what the particular parameter is needed for. -
defaultValue
A default value that overrides the default set by the parameter type. -
type
Information of the parameter type.
-
Constructor Details
-
PluginParameter
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 Details
-
toString
-
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
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
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
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
Get the default value for this parameter or null if no default has been specified- Returns:
- The default value
-
getParameterType
Get the parameter type, which tells the client application the data type and allowed values for the parameter.- Returns:
- A
ParameterType
object
-