Parameters.xml file.
- Version:
- 1.0 October 2009
- Author:
- pvtroshin
RunnerConfig
public RunnerConfig()
copyAndValidateRConfig
public RunnerConfig<T> copyAndValidateRConfig(RunnerConfig<?> runnerConf)
getOptions
public List<Option<T>> getOptions()
- Returns the list of the Options supported by the executable of type T
- Returns:
- list of
Option
supported by type T - See Also:
Option
addParameter
public void addParameter(Parameter<T> param)
- Adds parameter to the internal parameter list
- Parameters:
param
- the Parameter
to add- See Also:
Parameter
addOption
public void addOption(Option<T> option)
- Adds Option to the internal list of options
- Parameters:
option
- the Option
to add
getArguments
public List<Option<T>> getArguments()
- Returns list of
Parameter
and Option
supported by current
runner
- Returns:
- list of
Option
and Parameter
supported by type T
getPrmSeparator
public String getPrmSeparator()
- Returns:
- name value separator character
setPrmSeparator
public void setPrmSeparator(String prmSeparator)
- Sets name value separator character
- Parameters:
prmSeparator
- the separator char
setOptions
public void setOptions(List<Option<T>> parameters)
- Adds the list of options or parameters to the internal list of options
- Parameters:
parameters
- the list of parameters to add
getRunnerClassName
public String getRunnerClassName()
- Returns:
- fully qualified class name for type T
setRunnerClassName
public void setRunnerClassName(String runnerClassName)
- Set the name of a runner class
- Parameters:
runnerClassName
- the name of the executable wrapping class
setParameters
public void setParameters(List<Parameter<T>> parameters)
- Sets the list of parameters as internal list
- Parameters:
parameters
- the list of parameters
getParameters
public List<Parameter<T>> getParameters()
- Returns the list of parameters supported executable of type T. Where
Parameter
is an Option
with value.
- Returns:
- List of
Parameter
supported by type T.
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
getArgument
public Option<T> getArgument(String name)
- Returns the argument by its name if found, NULL otherwise. Where the
Argument is a common interface for
Option
and Parameter
therefore this method can return either. If you need to retrieve the
Option by its optionNames use @link
getArgumentByOptionName(String)
method. The
difference between option name and optionName is explained by the
following example:
Sequence type
--nuc - Assume the sequences are nucleotide.
--amino - Assume the sequences are amino acid.
--amino
--nuc
--auto
In the example, the "Sequence type" is a name whereas --amino, --nuc and
--auto are all optionNames. This dichotomy only manifests in
Option
never in Parameters
as the latter can
only have single element
- Parameters:
name
- the Parameter of Option name
- Returns:
Argument
removeArgument
public boolean removeArgument(String name)
- Removes the argument
Argument
if found. Where Argument is either
Option
or Parameter
.
- Parameters:
name
- of the argument
- Returns:
- true if argument was removed, false otherwise
getArgumentByOptionName
public Option<T> getArgumentByOptionName(String optionName)
- Returns the argument by option name, NULL if the argument is not found
- Parameters:
optionName
- - the optionName. This is not the same as an Option name.
For example:
Output sequences order
--inputorder - Output order: same as input.
--reorder - Output order: aligned. Default: same as input
--inputorder
--reorder
The name of the option in the example is
"Output sequences order" whereas optionNames are
"--inputorder" and "--reorder". If you need to retrieve the
Option or Parameter by its names use
getArgument(String)
method
- Returns:
- Option
removeArgumentByOptionName
public boolean removeArgumentByOptionName(String optionName)
- Removes the argument which can be a Parameter or an Option instance by
the value in element of the runner configuration
descriptor.
- Parameters:
optionName
- the optionName of the option, do not confuse with the name!
- Returns:
- true if argument with optionName exists and was removed, false
otherwise
- See Also:
for destinctions
between optionNames and the name of the Option
validate
public void validate()
throws ValidationException
- Validate the value of the argument. Checks whether the argument value is
in the valid values range.
- Throws:
ValidationException
- if any of the arguments found invalid which is when
- Parameter value outside
ValueConstrain
boundary
- Parameter name is not listed in possible values