de.jstacs.utils.galaxy
Class MultilineSimpleParameter
java.lang.Object
de.jstacs.AnnotatedEntity
de.jstacs.parameters.Parameter
de.jstacs.parameters.SimpleParameter
de.jstacs.utils.galaxy.MultilineSimpleParameter
- All Implemented Interfaces:
- GalaxyConvertible, Rangeable, Storable, Cloneable
public class MultilineSimpleParameter
- extends SimpleParameter
An extension of SimpleParameter
that renders as a textarea in Galaxy, which is only suitable for DataType.STRING
s.
Besides the toGalaxy(String, String, int, StringBuffer, StringBuffer, boolean)
and fromGalaxy(String, StringBuffer)
, all functionality is inherited from SimpleParameter
.
- Author:
- Jan Grau
Constructor Summary |
MultilineSimpleParameter(StringBuffer representation)
The standard constructor for the interface Storable . |
MultilineSimpleParameter(String name,
String comment,
boolean required)
Creates a new MultilineSimpleParameter with no default value. |
MultilineSimpleParameter(String name,
String comment,
boolean required,
Object defaultVal)
Creates a new MultilineSimpleParameter with given default value. |
MultilineSimpleParameter(String name,
String comment,
boolean required,
ParameterValidator validator)
Creates a new MultilineSimpleParameter with no default value and a ParameterValidator . |
MultilineSimpleParameter(String name,
String comment,
boolean required,
ParameterValidator validator,
Object defaultVal)
Creates a new MultilineSimpleParameter with given default value and a ParameterValidator . |
Method Summary |
void |
fromGalaxy(String namePrefix,
StringBuffer command)
Parses the contents of command in the format defined by configBuffer of GalaxyConvertible.toGalaxy(String, String, int, StringBuffer, StringBuffer, boolean)
and sets the values of the Parameter or ParameterSet accordingly. |
void |
toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer,
boolean addLine)
Creates an Galaxy XML-representation of the parameters and appends it to descBuffer
and variable configuration and appends it to configBuffer . |
Methods inherited from class de.jstacs.parameters.SimpleParameter |
appendFurtherInfos, checkValue, clone, equals, extractFurtherInfos, getErrorMessage, getRangedInstance, getValidator, getValue, getXMLTag, hasDefaultOrIsSet, isAtomic, isRangeable, isRequired, isSet, reset, setDefault, setRangeable, setValidator, setValue, toString |
MultilineSimpleParameter
public MultilineSimpleParameter(String name,
String comment,
boolean required,
Object defaultVal)
throws SimpleParameter.DatatypeNotValidException,
SimpleParameter.IllegalValueException
- Creates a new
MultilineSimpleParameter
with given default value.
- Parameters:
name
- the name of the parametercomment
- a comment on the parameter that tells the user some details
about itrequired
- determines if the parameter is requireddefaultVal
- the default value
- Throws:
DatatypeNotValidException
- if datatype
is not in
the values allowed for a SimpleParameter
IllegalValueException
- if the default value is not a valid value with respect
to datatype
SimpleParameter.DatatypeNotValidException
SimpleParameter.IllegalValueException
MultilineSimpleParameter
public MultilineSimpleParameter(String name,
String comment,
boolean required,
ParameterValidator validator,
Object defaultVal)
throws ParameterException
- Creates a new
MultilineSimpleParameter
with given default value and a ParameterValidator
.
- Parameters:
name
- the name of the parametercomment
- a comment on the parameter that tells the user some details
about itrequired
- determines if the parameter is requiredvalidator
- the validator for the parameter valuesdefaultVal
- the default value
- Throws:
ParameterException
- if either the default value is not a valid value with respect
to datatype
or datatype
is not in
the values allowed for a SimpleParameter
MultilineSimpleParameter
public MultilineSimpleParameter(String name,
String comment,
boolean required,
ParameterValidator validator)
throws SimpleParameter.DatatypeNotValidException
- Creates a new
MultilineSimpleParameter
with no default value and a ParameterValidator
.
- Parameters:
name
- the name of the parametercomment
- a comment on the parameter that tells the user some details
about itrequired
- determines if the parameter is requiredvalidator
- the validator for the parameter values
- Throws:
DatatypeNotValidException
- if datatype
is not in the values allowed for a
SimpleParameter
SimpleParameter.DatatypeNotValidException
MultilineSimpleParameter
public MultilineSimpleParameter(String name,
String comment,
boolean required)
throws SimpleParameter.DatatypeNotValidException
- Creates a new
MultilineSimpleParameter
with no default value.
- Parameters:
name
- the name of the parametercomment
- a comment on the parameter that tells the user some details
about itrequired
- determines if the parameter is required
- Throws:
DatatypeNotValidException
- if datatype
is not one of the allowed
DataType
s
SimpleParameter.DatatypeNotValidException
MultilineSimpleParameter
public MultilineSimpleParameter(StringBuffer representation)
throws NonParsableException
- The standard constructor for the interface
Storable
.
Constructs a MultilineSimpleParameter
out of an XML representation.
- Parameters:
representation
- the XML representation as StringBuffer
- Throws:
NonParsableException
- if the SimpleParameter
could not be restored from the
StringBuffer
representation
toGalaxy
public void toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer,
boolean addLine)
throws Exception
- Description copied from interface:
GalaxyConvertible
- Creates an Galaxy XML-representation of the parameters and appends it to
descBuffer
and variable configuration and appends it to configBuffer
. The variable configuration
is also used to parse user-supplied values returned by Galaxy.
- Specified by:
toGalaxy
in interface GalaxyConvertible
- Overrides:
toGalaxy
in class SimpleParameter
- Parameters:
namePrefix
- the prefix of the variable name used in GalaxyconfigPrefix
- the prefix for conditionalsdepth
- the depth in the parameter hierarchy, used for graphical representation of nestingdescBuffer
- the buffer for the parameter descriptionconfigBuffer
- the buffer for the configuration lineaddLine
- if true, a line is added before the title of a parameter
- Throws:
Exception
- if the conversion fails
fromGalaxy
public void fromGalaxy(String namePrefix,
StringBuffer command)
throws Exception
- Description copied from interface:
GalaxyConvertible
- Parses the contents of
command
in the format defined by configBuffer
of GalaxyConvertible.toGalaxy(String, String, int, StringBuffer, StringBuffer, boolean)
and sets the values of the Parameter
or ParameterSet
accordingly.
- Specified by:
fromGalaxy
in interface GalaxyConvertible
- Overrides:
fromGalaxy
in class SimpleParameter
- Parameters:
namePrefix
- the prefix of the variable namecommand
- the command string
- Throws:
Exception
- if the command string could not be parsed