Changeset 384 for trunk/uk/ac/ebi/AnnotationTypeCvImporter
- Timestamp:
- Aug 9, 2007, 4:47:05 PM (16 years ago)
- Location:
- trunk/uk/ac/ebi/AnnotationTypeCvImporter
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/uk/ac/ebi/AnnotationTypeCvImporter/src/uk/ac/ebi/nugo/plugins/AnnotationTypeCvImporter.java
r378 r384 35 35 import net.sf.basedb.util.parser.Mapper; 36 36 import net.sf.basedb.util.Values; 37 import uk.ac.ebi.nugo.plugins.util.ValueFormatter; 37 38 38 39 … … 511 512 if (category != null) 512 513 { 513 List<String> annotationTypeCategory= Values.getList(columnMappings.get("categoryColumnMapping").getValue(data),";"); 514 List<String> annotationTypeCategory= 515 ValueFormatter.getList(columnMappings.get("categoryColumnMapping").getValue(data),";"); 514 516 515 517 for (int i=0, z=annotationTypeCategory.size(); i<z;i++) … … 540 542 if (enumeration) 541 543 annotationType.setValues 542 (Value s.getList(columnMappings.get("cvValueColumnMapping").getValue(data),";"));544 (ValueFormatter.getList(columnMappings.get("cvValueColumnMapping").getValue(data),";")); 543 545 544 546 itemType= columnMappings.get("itemTypeColumnMapping").getValue(data); … … 546 548 { 547 549 Item[] items=Item.values(); 548 List<String> itemTypes=Value s.getList(columnMappings.get("itemTypeColumnMapping").getValue(data),separator);550 List<String> itemTypes=ValueFormatter.getList(columnMappings.get("itemTypeColumnMapping").getValue(data),separator); 549 551 for (String itemType: itemTypes) 550 552 { -
trunk/uk/ac/ebi/AnnotationTypeCvImporter/src/uk/ac/ebi/nugo/plugins/util/ValueFormatter.java
r378 r384 8 8 9 9 import java.text.SimpleDateFormat; 10 import java.util.ArrayList;11 10 import java.util.Arrays; 12 import java.util.Collection;13 11 import java.util.Date; 14 12 import java.util.List; 15 13 import java.util.regex.PatternSyntaxException; 14 15 import net.sf.basedb.core.BaseException; 16 16 /** 17 17 A utility class containing static methods for formatting parameter values. … … 24 24 public class ValueFormatter 25 25 { 26 26 27 27 private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); 28 28 … … 74 74 } 75 75 76 /** 77 * Convert a string value with a delimeter into a list 78 * @param values, the values to convert 79 * @param delimeter, the delimeter in the string 80 * @return the list of string values 81 */ 82 public static final List<String> getList(String values, String delimeter) 83 { 84 List<String> value = null; 85 String[] result; 86 if (values != null ) 87 { 88 try 89 { 90 result =values.split(delimeter); 91 value= Arrays.asList(result); 92 } 93 catch(PatternSyntaxException pse) 94 { 95 new BaseException(pse.getMessage()); 96 } 97 } 98 return value; 99 } 76 100 77 101
Note: See TracChangeset
for help on using the changeset viewer.