import jalview.ws.rest.InputType;
import jalview.ws.rest.NoValidInputDataException;
import jalview.ws.rest.RestJob;
+import jalview.ws.rest.RestServiceDescription;
import jalview.ws.rest.InputType.molType;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
+import java.util.List;
import java.util.Vector;
import org.apache.http.entity.mime.content.ContentBody;
minsize=1;
}
}
-}
\ No newline at end of file
+ @Override
+ public List<String> getURLEncodedParameter()
+ {
+ ArrayList<String> prms = new ArrayList<String>();
+ super.addBaseParams(prms);
+ prms.add("minsize='"+ minsize+"'");
+ prms.add("sep='"+ sep+"'");
+ if (type!=null)
+ {
+ prms.add("type='"+type+"'");
+ }
+ return prms;
+ }
+
+ @Override
+ public String getURLtokenPrefix()
+ {
+ return "PARTITION";
+ }
+
+ @Override
+ public boolean configureProperty(String tok, String val,
+ StringBuffer warnings)
+ {
+
+ if (tok.startsWith("sep"))
+ {
+ sep=val;
+ return true;
+ }
+ if (tok.startsWith("minsize"))
+ {
+ try {
+ minsize=Integer.valueOf(val);
+ if (minsize>=0)
+ return true;
+ } catch (Exception x)
+ {
+
+ }
+ warnings.append("Invalid minsize value '"+val+"'. Must be a positive integer.\n");
+ }
+ if (tok.startsWith("type"))
+ {
+ try {
+ type=molType.valueOf(val);
+ return true;
+ } catch (Exception x)
+ {
+ warnings.append("Invalid molecule type '"+val+"'. Must be one of (");
+ for (molType v:molType.values())
+ {
+ warnings.append(" "+v);
+ }
+ warnings.append(")\n");
+ }
+ }
+ return false;
+ }
+
+}