import java.util.List;
/**
+ * BH 2018 SwingJS note: If additional final static Strings are added to this
+ * file, they should be added to public static final String[] allTypes.
+ *
* Defines internal constants for unambiguous annotation of DbRefEntry source
* strings and describing the data retrieved from external database sources (see
* jalview.ws.DbSourcProxy) <br/>
* (e.g. protein coding, alignment (ortholog db, paralog db, domain db),
* genomic, transcriptomic, 3D structure providing (PDB, MODBASE, etc) ..).
*
+ *
+ *
* @author JimP
*
*/
public class DBRefSource
{
+
+
+
/**
* UNIPROT Accession Number
*/
*/
public static final String UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase();
- public static final String EMBLCDSProduct = "EMBLCDSProtein"
- .toUpperCase();
+ public static final String EMBLCDSProduct = "EMBLCDSProtein".toUpperCase();
+
/**
* PDB Entry Code
*/
*/
public static final String EMBLCDS = "EMBLCDS";
+
/**
* PFAM ID
*/
*/
public static final String GENEDB = "GeneDB".toUpperCase();
+
/**
* Ensembl
*/
public static final String ENSEMBLGENOMES = "ENSEMBLGENOMES";
- /**
+
+ /**
* List of databases whose sequences might have coding regions annotated
*/
public static final String[] DNACODINGDBS = { EMBL, EMBLCDS, GENEDB,
public static final String[] PROTEINDBS = { UNIPROT, UNIPROTKB,
EMBLCDSProduct, ENSEMBL }; // Ensembl ENSP* entries are protein
+
+ public static final String[] allTypes = new String[] {
+ UNIPROT, UP_NAME, UNIPROTKB,
+ EMBLCDSProduct, PDB, EMBL,
+ EMBLCDS, PFAM, RFAM,
+ GENEDB, ENSEMBL, ENSEMBLGENOMES
+ };
+
+
+ public static String[] allSourcesFromReflection;
+
public static String[] allSources()
+
{
- List<String> src = new ArrayList<>();
- for (Field f : DBRefSource.class.getFields())
+ /**
+ * @j2sNative
+ *
+ * return C$.allTypes;
+ *
+ */
+
{
- if (String.class.equals(f.getType()))
+ if (allSourcesFromReflection == null)
{
- try
- {
- src.add((String) f.get(null));
- } catch (Exception x)
+ List<String> src = new ArrayList<>();
+ for (Field f : DBRefSource.class.getFields())
{
- x.printStackTrace();
+ if (String.class.equals(f.getType()))
+ {
+ try
+ {
+ src.add((String) f.get(null));
+ } catch (Exception x)
+ {
+ x.printStackTrace();
+ }
+ }
}
+ allSourcesFromReflection = src.toArray(new String[0]);
}
+ return allSourcesFromReflection;
}
- return src.toArray(new String[0]);
}
+
+
}