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.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.http.entity.mime.content.ContentBody;
import org.apache.http.entity.mime.content.StringBody;
* @author JimP
*
*/
-class SeqIdVector extends InputType {
+public class SeqIdVector extends InputType {
public SeqIdVector()
{
super(new Class[] { AlignmentI.class} );
idvector.append(seq.getName());
}
return new StringBody(idvector.toString());
+ }
+ @Override
+ public List<String> getURLEncodedParameter()
+ {
+ ArrayList<String> prms = new ArrayList<String>();
+ super.addBaseParams(prms);
+ prms.add("sep='"+ sep+"'");
+ prms.add("type='"+type+"'");
+ return prms;
+ }
+ @Override
+ public String getURLtokenPrefix()
+ {
+ return "SEQIDS";
+ }
+ @Override
+ public boolean configureProperty(String tok, String val, StringBuffer warnings)
+ {
+ if (tok.startsWith("sep"))
+ {
+ sep=val;
+ return true;
+ }
+ 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;
}
-}
\ No newline at end of file
+}