[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Sat Mar 10 00:33:16 UTC 2007


gordonp
Fri Mar  9 19:33:16 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util
In directory dev.open-bio.org:/tmp/cvs-serv28310/src/main/ca/ucalgary/services/util

Modified Files:
	ACDFile.java 
Log Message:
Added handling for ACD file subsections (ignore by MOBY, as all secondary params are at the same level)
moby-live/Java/src/main/ca/ucalgary/services/util ACDFile.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java	2007/03/09 18:01:09	1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/ACDFile.java	2007/03/10 00:33:16	1.3
@@ -12,6 +12,7 @@
 public class ACDFile{
     private List<Map<String,String>> application;
     private List<Map<String,String>> input;
+    private List<Map<String,String>> required;
     private List<Map<String,String>> additional;
     private List<Map<String,String>> advanced;
     private List<Map<String,String>> output;
@@ -52,6 +53,7 @@
 
 	StringBuffer applicationSection = new StringBuffer();
 	StringBuffer inputSection = new StringBuffer();
+	StringBuffer requiredSection = new StringBuffer();
 	StringBuffer additionalParamsSection = new StringBuffer();
 	StringBuffer advancedParamsSection = new StringBuffer();
 	StringBuffer outputSection = new StringBuffer();
@@ -84,6 +86,20 @@
 		    inputSection.append(line+"\n");
 		}
 	    }
+
+	    else if(line.matches("^\\s*section\\s*:\\s*required\\s*\\[")){
+                for(line = reader.readLine(); line != null; line = reader.readLine()){
+		    if(line.matches("^\\s*]")){
+			break;
+		    }
+		}
+                for(line = reader.readLine(); line != null; line = reader.readLine()){
+		    if(line.matches("^\\s*endsection\\s*:\\s*required")){
+			break;
+		    }
+		    requiredSection.append(line+"\n");
+		}
+	    }
 	    
 	    else if(line.matches("^\\s*section:\\s*additional\\s*\\[")){
                 for(line = reader.readLine(); line != null; line = reader.readLine()){
@@ -131,6 +147,7 @@
 	// Populate the sections
 	application = acdSectionToTagValuePairs(applicationSection.toString());
 	input = acdSectionToTagValuePairs(inputSection.toString());
+	required = acdSectionToTagValuePairs(requiredSection.toString());
 	additional = acdSectionToTagValuePairs(additionalParamsSection.toString());
 	advanced = acdSectionToTagValuePairs(advancedParamsSection.toString());
 	output = acdSectionToTagValuePairs(outputSection.toString());
@@ -152,6 +169,10 @@
 	return input;
     }
 
+    public List<Map<String,String>> getRequiredParamsSection(){
+	return required;
+    }
+
     public List<Map<String,String>> getAdditionalParamsSection(){
 	return additional;
     }
@@ -180,9 +201,14 @@
 	    if(line.matches("^\\s*\\S+\\s*:\\s*\\S+\\s*\\[\\s*$")){
 		String blockType = line.replaceAll("^\\s*(\\S+)\\s*:\\s*\\S+\\s*\\[\\s*$", "$1");
 		String blockName = line.replaceAll("^\\s*\\S+\\s*:\\s*(\\S+)\\s*\\[\\s*$", "$1");
+		boolean subsection = line.matches("^\\s*section\\s*:\\s*\\S*\\s*\\[");
 
 		for(line = reader.readLine(); line != null; line = reader.readLine()){
 		    if(line.matches("^\\s*]")){
+			if(subsection){
+			    System.err.println("Ignoring subsection:\n" + blockText.toString());
+			    break; // ignore subsection specifications (MOBY 2ndary params don't hav'em)
+			}
 			Map<String,String> block = acdBlockToTagValuePairs(blockText.toString());
 			block.put(BLOCK_TYPE_KEY, blockType);
 			block.put(BLOCK_NAME_KEY, blockName);
@@ -192,6 +218,9 @@
 		    blockText.append(line+"\n");
 		}		
 	    }
+	    else if(line.matches("^\\s*endsection:\\s*\\S+")){
+		// ignore subsection info
+            }
 	    else{
 		throw new Exception("Unexpected content where blocks expected: "+line);
 	    }




More information about the MOBY-guts mailing list