X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FDBRefSource.java;h=47d108219da87faafeaa324d95675396dc127336;hb=7047b076a62df177047ceb16c3611efe020bdd76;hp=0ac14e54e8ebc38f8f1722df64abef6782335297;hpb=72f71a390ca98525f99a5dcecc1202696b20e0d7;p=jalview.git
diff --git a/src/jalview/datamodel/DBRefSource.java b/src/jalview/datamodel/DBRefSource.java
index 0ac14e5..47d1082 100755
--- a/src/jalview/datamodel/DBRefSource.java
+++ b/src/jalview/datamodel/DBRefSource.java
@@ -25,6 +25,9 @@ import java.util.ArrayList;
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)
@@ -32,11 +35,16 @@ import java.util.List;
* (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
*/
@@ -52,9 +60,9 @@ public class DBRefSource
*/
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
*/
@@ -70,6 +78,7 @@ public class DBRefSource
*/
public static final String EMBLCDS = "EMBLCDS";
+
/**
* PFAM ID
*/
@@ -85,6 +94,7 @@ public class DBRefSource
*/
public static final String GENEDB = "GeneDB".toUpperCase();
+
/**
* Ensembl
*/
@@ -92,33 +102,61 @@ public class DBRefSource
public static final String ENSEMBLGENOMES = "ENSEMBLGENOMES";
- /**
+
+ /**
* List of databases whose sequences might have coding regions annotated
*/
public static final String[] DNACODINGDBS = { EMBL, EMBLCDS, GENEDB,
- ENSEMBL };
+ ENSEMBL, ENSEMBLGENOMES };
public static final String[] CODINGDBS = { EMBLCDS, GENEDB, ENSEMBL };
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 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 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]);
}
+
+
}