ff54654dc8ea73d9f712bb589ea6673d35ac134d
[jalview.git] / src / jalview / ws / rest / params / Tree.java
1 package jalview.ws.rest.params;
2
3 import jalview.datamodel.AlignmentI;
4 import jalview.ws.params.ArgumentI;
5 import jalview.ws.params.OptionI;
6 import jalview.ws.rest.InputType;
7 import jalview.ws.rest.RestJob;
8 import jalview.ws.rest.RestServiceDescription;
9 import jalview.ws.rest.InputType.molType;
10
11 import java.io.UnsupportedEncodingException;
12 import java.util.ArrayList;
13 import java.util.List;
14
15 import org.apache.http.entity.mime.content.ContentBody;
16
17 /**
18  * format a tree for input to a rest service
19  * @author JimP
20  *
21  */
22 public class Tree extends InputType {
23   public Tree()
24   {
25     super(new Class[] { jalview.analysis.NJTree.class} );
26   }
27
28   // TODO specify modifiers for tree output format
29   @Override
30   public ContentBody formatForInput(RestJob rj) throws UnsupportedEncodingException
31   {
32     // TODO: implement tree inputType
33     /*rj.getTreeForInput(token);
34     return new StringBody(new ) */
35     throw new Error("Tree InputType not yet implemented");
36     //return null;
37   }
38   public String getURLtokenPrefix()
39   {
40     return "NEWICK"; 
41   }
42   
43   @Override
44   public List<String> getURLEncodedParameter()
45   {
46     ArrayList<String> prms = new ArrayList<String>();
47     super.addBaseParams(prms);
48     return prms;
49   }
50
51   @Override
52   public boolean configureProperty(String tok, String val,
53           StringBuffer warnings)
54   {
55     return true;
56   }
57
58   @Override
59   public List<OptionI> getOptions()
60   {
61     return getBaseOptions();
62   }
63
64 }