3 import jalview.datamodel.Alignment;
\r
4 import jalview.datamodel.DBRefSource;
\r
5 import jalview.io.FormatAdapter;
\r
6 import jalview.io.IdentifyFile;
\r
8 import java.util.Hashtable;
\r
11 * common methods for implementations of the DbSourceProxy interface.
\r
16 public abstract class DbSourceProxyImpl implements DbSourceProxy
\r
18 public DbSourceProxyImpl()
\r
20 // default constructor - do nothing probably.
\r
22 private Hashtable props=null;
\r
24 * @see jalview.ws.DbSourceProxy#getDbSourceProperties()
\r
26 public Hashtable getDbSourceProperties()
\r
30 protected void addDbSourceProperty(Object propname)
\r
32 addDbSourceProperty(propname, propname);
\r
35 protected void addDbSourceProperty(Object propname, Object propvalue)
\r
39 props = new Hashtable();
\r
41 props.put(propname, propvalue);
\r
43 boolean queryInProgress=false;
\r
44 protected StringBuffer results = null;
\r
48 * @see jalview.ws.DbSourceProxy#getRawRecords()
\r
50 public StringBuffer getRawRecords()
\r
56 * @see jalview.ws.DbSourceProxy#queryInProgress()
\r
58 public boolean queryInProgress()
\r
60 return queryInProgress;
\r
63 * call to set the queryInProgress flag
\r
66 protected void startQuery()
\r
68 queryInProgress=true;
\r
71 * call to clear the queryInProgress flag
\r
74 protected void stopQuery()
\r
76 queryInProgress=false;
\r
80 * create an alignment from raw text file...
\r
82 * @return null or a valid alignment
\r
85 protected Alignment parseResult(String result) throws Exception {
\r
86 Alignment sequences = null;
\r
87 String format = new IdentifyFile().Identify(result, "Paste");
\r
88 if (FormatAdapter.isValidFormat(format))
\r
90 sequences = new FormatAdapter().readFile(result.toString(), "Paste",
\r