[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Tue Apr 3 02:30:36 UTC 2007


gordonp
Mon Apr  2 22:30:36 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services
In directory dev.open-bio.org:/tmp/cvs-serv6761/src/main/ca/ucalgary/seahawk/services

Modified Files:
	MobyComplexBuilder.java 
Log Message:
Flanking whitespace processing for rules, start of implicit iteration code for HAS rules
moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyComplexBuilder.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java	2007/03/12 14:38:38	1.3
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java	2007/04/03 02:30:36	1.4
@@ -148,10 +148,19 @@
 		for(int i = 0; i < children.length; i++){
 		    String memberName = children[i].getName();
 		    String[] resultSpec = (String[]) memberRules.get(memberName);
+		    MobyRelationship memberRelationship = mobyDataType.getChild(memberName);
 		    String result = resultSpec[0];
 		    byte[] resultBytes = result.getBytes();
 		    String whitespaceMode = resultSpec[1];
 		    String encodingMode = resultSpec[2];
+		    
+		    // Is the field a list rather than a single value?  If so,
+		    // we will need to reinterpret the member value specification
+		    // as many times as the regex capture group matched...
+		    if(memberRelationship.getRelationshipType() == Central.iHAS){
+			
+		    }
+		    // else is iHASA, scalar context
 
 		    boolean nonBasic = result.length() != 2 || result.indexOf("$") != 0;
 		    MobyPrefixResolver.MobyNodeList nodeList = new MobyPrefixResolver.MobyNodeList();
@@ -192,6 +201,9 @@
 			    else if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_STRIP_VAL)){
 				varValue = varValue.replaceAll("\\s+","");
 			    }
+			    else if(whitespaceMode.equals(MobyClient.WHITESPACE_ATTR_STRIP_FLANKING_VAL)){
+				varValue = varValue.trim(); // removes leading and trailing whitespace
+			    }
 			    result = result.replaceAll("\\$"+j, varValue);
 
 			    // Binary data and XPath are incompatible, since many bytes are not allowed in XML
@@ -201,12 +213,12 @@
 		    }
 
 		    if(encodingMode.equals(MobyClient.ENCODING_ATTR_BASE64_VAL)){
-			(new Exception("Base 64 encoding")).printStackTrace();
+			//(new Exception("Base 64 encoding")).printStackTrace();
 			result = org.apache.axis.encoding.Base64.encode(data == null ? result.getBytes() : resultBytes);
 		    }
 		    else{
-			System.err.println("NO BASE64 (" + MobyClient.ENCODING_ATTR_BASE64_VAL + 
-					   ") ENCODING for " +memberName+": " + encodingMode);
+			//System.err.println("NO BASE64 (" + MobyClient.ENCODING_ATTR_BASE64_VAL + 
+			//		   ") ENCODING for " +memberName+": " + encodingMode);
 		    }
 
 		    // If the value contains anything other than $#, treat it as a XPath expression 




More information about the MOBY-guts mailing list