|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.AnnotatedEntity
de.jstacs.parameters.Parameter
de.jstacs.parameters.ParameterSetContainer
public class ParameterSetContainer
Class for a ParameterSetContainer that contains a
ParameterSet as value. This ParameterSet can be set either
using the constructor or using the method setValue(Object) and can
be obtained by the method getValue(). ParameterSetContainers
can be used to build tree-structures of Parameters.
| Field Summary | |
|---|---|
protected String |
errorMessage
The message of the last error or null if no error occurred. |
| Fields inherited from class de.jstacs.parameters.Parameter |
|---|
parent |
| Fields inherited from class de.jstacs.AnnotatedEntity |
|---|
comment, datatype, name |
| Constructor Summary | |
|---|---|
ParameterSetContainer(Class<? extends ParameterSet> contentClazz)
Creates an new ParameterSetContainer out of the class
of a ParameterSet. |
|
ParameterSetContainer(ParameterSet p)
Creates an new ParameterSetContainer out of a ParameterSet. |
|
ParameterSetContainer(StringBuffer representation)
The standard constructor for the interface Storable. |
|
ParameterSetContainer(String name,
String comment,
Class<? extends ParameterSet> contentClazz)
Creates an new ParameterSetContainer out of the class
of a ParameterSet. |
|
ParameterSetContainer(String name,
String comment,
ParameterSet content)
Creates an new ParameterSetContainer out of a
ParameterSet. |
|
| Method Summary | |
|---|---|
protected void |
appendFurtherInfos(StringBuffer buf)
This method can be used in the method Storable.toXML() to extract
further information (name, comment, datatype). |
boolean |
checkValue(Object value)
Checks the value for correctness, e.g. for numerical parameters this might be checking if the value is within specified bounds. |
ParameterSetContainer |
clone()
|
protected void |
extractFurtherInfos(StringBuffer representation)
This method can be used in the constructor with parameter StringBuffer to
extract the further information. |
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)
and sets the values of the Parameter or ParameterSet accordingly. |
String |
getErrorMessage()
If a value could not be set successfully this method returns the corresponding error message. |
ParameterSet |
getValue()
Returns the value of the AnnotatedEntity. |
String |
getXMLTag()
This method returns a tag used as outer tag of the XML description. |
boolean |
hasDefaultOrIsSet()
Returns true if the parameter either has a default value or
the value was set by the user, false otherwise. |
boolean |
isAtomic()
Returns true if the parameter is of an atomic data type,
false otherwise. |
boolean |
isRequired()
Returns true if the Parameter is required,
false otherwise. |
boolean |
isSet()
Returns true if the parameter was set by the user,
false otherwise. |
void |
reset()
Resets the parameter and its contents to the default values or null if no defaults are given. |
void |
setDefault(Object defaultValue)
Sets the default value of the Parameter to
defaultValue. |
void |
setValue(Object value)
Sets the value of this Parameter to value. |
void |
toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer)
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.Parameter |
|---|
getParent, isComparable, setParent |
| Methods inherited from class de.jstacs.AnnotatedEntity |
|---|
getComment, getDatatype, getName, toXML |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String errorMessage
null if no error occurred.
| Constructor Detail |
|---|
public ParameterSetContainer(ParameterSet p)
ParameterSetContainer out of a ParameterSet.
p - the content of the ParameterSetContainer (the
contained ParameterSet)ParameterSet.getName(ParameterSet),
ParameterSet.getComment(ParameterSet)public ParameterSetContainer(String name,
String comment,
ParameterSet content)
ParameterSetContainer out of a
ParameterSet.
name - the name of the ParameterSetContainercomment - a comment on the ParameterSetContainercontent - the content of the ParameterSetContainer (the
contained ParameterSet)public ParameterSetContainer(Class<? extends ParameterSet> contentClazz)
ParameterSetContainer out of the class
of a ParameterSet.
contentClazz - the class of the contained ParameterSetParameterSet.getName(Class),
ParameterSet.getComment(Class)public ParameterSetContainer(String name,
String comment,
Class<? extends ParameterSet> contentClazz)
ParameterSetContainer out of the class
of a ParameterSet.
name - the name of the ParameterSetContainercomment - a comment on the ParameterSetContainercontentClazz - the class of the contained ParameterSetpublic ParameterSetContainer(StringBuffer representation)
throws NonParsableException
Storable.
Creates a new ParameterSetContainer from its XML representation.
representation - the XML representation as StringBuffer
NonParsableException - if the StringBuffer representation could
not be parsed| Method Detail |
|---|
public ParameterSetContainer clone()
throws CloneNotSupportedException
clone in class ParameterCloneNotSupportedExceptionpublic boolean isRequired()
Parametertrue if the Parameter is required,
false otherwise.
isRequired in class Parametertrue if the Parameter is required,
false otherwisepublic boolean checkValue(Object value)
Parameter
checkValue in class Parametervalue - the value to be checked
true if the value is valid, false
otherwisepublic void setValue(Object value)
throws SimpleParameter.IllegalValueException
ParameterParameter to value.
setValue in class Parametervalue - the new value of the Parameter
SimpleParameter.IllegalValueException - if the specified value is not valid for this
Parameterpublic ParameterSet getValue()
AnnotatedEntityAnnotatedEntity.
getValue in class AnnotatedEntityAnnotatedEntitypublic boolean hasDefaultOrIsSet()
Parametertrue if the parameter either has a default value or
the value was set by the user, false otherwise.
hasDefaultOrIsSet in class Parametertrue if value has a default value or was set,
false otherwisepublic boolean isSet()
Parametertrue if the parameter was set by the user,
false otherwise.
isSet in class Parametertrue if the parameter was set, false
otherwisepublic boolean isAtomic()
Parametertrue if the parameter is of an atomic data type,
false otherwise.
isAtomic in class Parametertrue if the parameter is atomic, false
otherwisepublic String getErrorMessage()
Parameter
getErrorMessage in class Parameterpublic void reset()
Parameternull if no defaults are given.
reset in class Parameterpublic void setDefault(Object defaultValue)
throws Exception
ParameterParameter to
defaultValue. This method also sets the current
value of this Parameter to the default.
setDefault in class ParameterdefaultValue - the default value
Exception - if the default value is not an appropriate value for this
Parameterpublic String getXMLTag()
AnnotatedEntity
getXMLTag in class AnnotatedEntityprotected void appendFurtherInfos(StringBuffer buf)
AnnotatedEntityStorable.toXML() to extract
further information (name, comment, datatype).
appendFurtherInfos in class Parameterbuf - a XML representation of the main information as
StringBufferStorable.toXML()protected void extractFurtherInfos(StringBuffer representation)
throws NonParsableException
AnnotatedEntityStringBuffer to
extract the further information.
extractFurtherInfos in class Parameterrepresentation - a XML represenation of the main information as
StringBuffer
NonParsableException - if the XML representation is not parsableAnnotatedEntity.AnnotatedEntity(StringBuffer)public void toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer)
throws Exception
GalaxyConvertibledescBuffer
and variable configuration and appends it to configBuffer. The variable configuation
is also used to parse user-supplied values returned by Galaxy.
toGalaxy in interface GalaxyConvertiblenamePrefix - 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 line
Exception - if the conversion failspublic void fromGalaxy(String namePrefix,
StringBuffer command)
throws Exception
GalaxyConvertiblecommand in the format defined by configBuffer of GalaxyConvertible.toGalaxy(String, String, int, StringBuffer, StringBuffer)
and sets the values of the Parameter or ParameterSet accordingly.
fromGalaxy in interface GalaxyConvertiblenamePrefix - the prefix of the variable namecommand - the command string
Exception - if the command string could not be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||