public class ParameterDefinition
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
defaultValue |
private java.lang.String |
description |
private static java.net.URL |
dtdFile |
private boolean |
multiple |
private java.lang.String |
name |
private java.util.Map<java.lang.String,java.lang.String> |
options |
private boolean |
required |
private java.lang.String |
type |
Constructor and Description |
---|
ParameterDefinition()
Create a new empty parameter definition.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultValue()
Get the default value for this parameter.
|
java.lang.String |
getDescription()
Get a description/help text about this parameter.
|
java.lang.String |
getName()
Get the name of the parameter.
|
java.lang.String |
getOption(java.lang.String key)
Get the value for an option.
|
java.util.Set<java.lang.String> |
getOptions()
Get the names of other options that are defined for this parmeter.
|
java.lang.String |
getType()
Get the type of the parameter.
|
boolean |
isMultiple()
Can this parameter have multiple values or only one?
|
boolean |
isRequired()
Is this parameter a required parameter or not?
|
static java.util.List<ParameterDefinition> |
parseXml(java.lang.String xml,
boolean validate)
Parse an XML document containing parameter definitions.
|
void |
setDefaultValue(java.lang.String defaultValue)
Set the default value for this parameter.
|
void |
setDescription(java.lang.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 |
setName(java.lang.String name)
Set the name of the parameter.
|
void |
setOption(java.lang.String key,
java.lang.String value)
Set the value for an option.
|
void |
setRequired(boolean required)
Set if this parameter should be a required or optional parameter.
|
void |
setType(java.lang.String type)
Set the type of the parameter.
|
PluginParameter<?> |
toPluginParameter(DbControl dc,
BioAssaySet source)
Convert this parameter definition to a PluginParameter object.
|
java.lang.String |
toXmlFragment(boolean compact)
Render this parameter definition as an XML fragment.
|
private static final java.net.URL dtdFile
private java.lang.String type
private java.lang.String name
private boolean required
private boolean multiple
private java.lang.String defaultValue
private java.lang.String description
private java.util.Map<java.lang.String,java.lang.String> options
public ParameterDefinition()
public static java.util.List<ParameterDefinition> parseXml(java.lang.String xml, boolean validate)
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)public java.lang.String getType()
public void setType(java.lang.String type)
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isRequired()
public void setRequired(boolean required)
public boolean isMultiple()
public void setMultiple(boolean multiple)
public java.lang.String getDefaultValue()
public void setDefaultValue(java.lang.String defaultValue)
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public java.util.Set<java.lang.String> getOptions()
public java.lang.String getOption(java.lang.String key)
public void setOption(java.lang.String key, java.lang.String value)
public java.lang.String toXmlFragment(boolean compact)
<!DOCTYPE parameter-definition SYSTEM "external-plugin-parameters.dtd"> <parameter-definition> ... </parameter-definition>
compact
- If TRUE, the generated XML is compacted and without line breaks.public PluginParameter<?> toPluginParameter(DbControl dc, BioAssaySet source)
dc
- A DbControl to use for database accesssource
- The source bioassay set