Package net.sf.basedb.plugins.executor
Class ParameterDefinition
java.lang.Object
net.sf.basedb.plugins.executor.ParameterDefinition
Represents a parameter definition for the external program.
A name and type is required. All other settings are optional.
Supported values for type is:
- string: The parameter is a free-text string parameter with a maximum length of 255 characters.
- text: The parameter is a free-text string parameter with a maximum length of 64K characters.
- integer, float: The parameter is a numeric parameter. Options 'min' and 'max' can be set to restrict the range of valid values.
- boolean: The parameter is a true/false parameter.
- enumeration: The parameter is an enumeration that must take it's value from a predefined list of values. The predefined list should be set in the 'enum' option with a line break as a delimiter between values.
- factor: The parameter is an enumeration among the experimental factors that has been defined for the experiment. The default value is matched against the name/external id of the annotation types.
- spotformula: The parameter is an enumeration among the formulas that can be used with the current source bioassay set. The default value is matched against the name of the formulas.
- assays: The parameter is an enumeration among the bioassays in the current source bioassay set. The default value is matched against the name of the bioassays.
- Since:
- 2.15
- Author:
- Nicklas
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the default value for this parameter.Get a description/help text about this parameter.getName()
Get the name of the parameter.Get the value for an option.Get the names of other options that are defined for this parmeter.getType()
Get the type of the parameter.boolean
Can this parameter have multiple values or only one?boolean
Is this parameter a required parameter or not?static List<ParameterDefinition>
Parse an XML document containing parameter definitions.void
setDefaultValue
(String defaultValue) Set the default value for this parameter.void
setDescription
(String description) Set a description/help text for this parmeter.void
setMultiple
(boolean multiple) Set if this parameter can have multiple values or only one.void
Set the name of the parameter.void
Set the value for an option.void
setRequired
(boolean required) Set if this parameter should be a required or optional parameter.void
Set the type of the parameter.toPluginParameter
(DbControl dc, BioAssaySet source) Convert this parameter definition to a PluginParameter object.toXmlFragment
(boolean compact) Render this parameter definition as an XML fragment.
-
Field Details
-
dtdFile
-
type
-
name
-
required
private boolean required -
multiple
private boolean multiple -
defaultValue
-
description
-
options
-
-
Constructor Details
-
ParameterDefinition
public ParameterDefinition()Create a new empty parameter definition. Before it can be used a name and type must be specified.
-
-
Method Details
-
parseXml
Parse an XML document containing parameter definitions.- Parameters:
xml
- The xml as a string (with or without a DOCTYPE declaration)validate
- TRUE to validate the XML against the dtd (external-plugin-parameters.dtd)- Returns:
- A list with parameter definition
-
getType
Get the type of the parameter. -
setType
Set the type of the parameter. For supported values see the class documentation. -
getName
Get the name of the parameter. This value is required. -
setName
Set the name of the parameter. -
isRequired
public boolean isRequired()Is this parameter a required parameter or not? -
setRequired
public void setRequired(boolean required) Set if this parameter should be a required or optional parameter. -
isMultiple
public boolean isMultiple()Can this parameter have multiple values or only one? -
setMultiple
public void setMultiple(boolean multiple) Set if this parameter can have multiple values or only one. -
getDefaultValue
Get the default value for this parameter. -
setDefaultValue
Set the default value for this parameter. -
getDescription
Get a description/help text about this parameter. -
setDescription
Set a description/help text for this parmeter. -
getOptions
Get the names of other options that are defined for this parmeter. Useful options depend on the parameter type and are described in the class documentation. -
getOption
Get the value for an option. -
setOption
Set the value for an option. -
toXmlFragment
Render this parameter definition as an XML fragment. Multiple fragments can be concatenated and then wrapped with:<!DOCTYPE parameter-definition SYSTEM "external-plugin-parameters.dtd"> <parameter-definition> ... </parameter-definition>
- Parameters:
compact
- If TRUE, the generated XML is compacted and without line breaks.- Returns:
- An XML representation of this parameter definition
-
toPluginParameter
Convert this parameter definition to a PluginParameter object.- Parameters:
dc
- A DbControl to use for database accesssource
- The source bioassay set
-