Option opt;
@Override
- public String getDefaultValue()
+ public String getValue()
{
return opt.getDefaultValue();
}
}
@Override
- public void setDefaultValue(String selectedItem)
+ public void setValue(String selectedItem)
{
try
{
}
@Override
- public Type getType()
+ public ValueType getType()
{
- // TODO: refactor to local Jalview parameter type system.
- return vc.getType();
+ if (vc.getType()==ValueConstrain.Type.Float) {
+ return ValueType.Float;
+ }
+ if (vc.getType()==ValueConstrain.Type.Integer) {
+ return ValueType.Integer;
+ }
+ throw new Error("IMPLEMENTATION ERROR: jalview.ws.params.ValueConstrainI.ValueType does not support the JABAWS type :"+vc.toString());
}
@Override
public interface ArgumentI
{
+ /**
+ *
+ * @return name for this argument
+ */
String getName();
- // TODO: rename setDefaultValue to setValue - to make it more semantically
- // obvious what it means!
- String getDefaultValue();
+ /**
+ *
+ * @return current value for the argument (may equal the name)
+ */
+ String getValue();
- void setDefaultValue(String selectedItem);
+ /**
+ * set the current value for the argument.
+ * @param selectedItem
+ */
+ void setValue(String selectedItem);
}
--- /dev/null
+/**
+ *
+ */
+package jalview.ws.params;
+
+/**
+ * Raised if an object configured by an instance of jalview.ws.params.ArgumentI
+ * is given an instance which it does not support.
+ */
+public class InvalidArgumentException extends Exception
+{
+
+ public InvalidArgumentException()
+ {
+ super();
+ }
+
+ public InvalidArgumentException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public InvalidArgumentException(String message)
+ {
+ super(message);
+ }
+
+ public InvalidArgumentException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
public interface ValueConstrainI
{
- // TODO: remove dependence on ValueConstraint.Type
- Type getType();
+ public enum ValueType {
+ Integer,
+ Float,
+ String
+ };
+ ValueType getType();
Number getMax();