From 33ddded54e265fccf85851d0ac3ad047ca4a8459 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 12 Jun 2009 15:43:42 +0000 Subject: [PATCH] more ID validation --- src/jalview/ws/dbsources/EmblCdsSouce.java | 5 ++--- src/jalview/ws/dbsources/EmblSource.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/jalview/ws/dbsources/EmblCdsSouce.java b/src/jalview/ws/dbsources/EmblCdsSouce.java index 41db106..a8dcda2 100644 --- a/src/jalview/ws/dbsources/EmblCdsSouce.java +++ b/src/jalview/ws/dbsources/EmblCdsSouce.java @@ -42,8 +42,7 @@ public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy public Regex getAccessionValidator() { - // TODO Auto-generated method stub - return null; + return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+"); } public String getDbSource() @@ -70,7 +69,7 @@ public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy { // most embl CDS refs look like .. // TODO: improve EMBLCDS regex - return (accession==null || accession.length()<2) ? false : new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+").search(accession); + return (accession==null || accession.length()<2) ? false : getAccessionValidator().search(accession); } /** diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index ac4a988..08c020e 100644 --- a/src/jalview/ws/dbsources/EmblSource.java +++ b/src/jalview/ws/dbsources/EmblSource.java @@ -65,8 +65,7 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy */ public Regex getAccessionValidator() { - // TODO Auto-generated method stub - return null; + return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+"); } /* @@ -109,7 +108,7 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy { // most embl refs look like .. - return (accession==null || accession.length()<2) ? false : new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+$").search(accession); + return (accession==null || accession.length()<2) ? false : getAccessionValidator().search(accession); } -- 1.7.10.2