[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Tue Mar 14 16:43:23 UTC 2006


kawas
Tue Mar 14 11:43:23 EST 2006
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv25829/org/biomoby/shared

Modified Files:
	MobyPrimaryDataSimple.java 
Log Message:
added lsids to the parsed object

moby-live/Java/src/main/org/biomoby/shared MobyPrimaryDataSimple.java,1.7,1.8
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java	2005/11/06 16:23:50	1.7
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java	2006/03/14 16:43:23	1.8
@@ -12,6 +12,8 @@
 import java.util.Vector;
 
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 /**
@@ -63,11 +65,27 @@
 	for (int i = 0; i < children.getLength(); i++) {
 	    String childName = children.item (i).getNodeName();
 	    if (childName.equals ("objectType")) {
-		if (children.item (i).getFirstChild() != null)
-		    setDataType (new MobyDataType (children.item (i).getFirstChild().getNodeValue()));
+		if (children.item (i).getFirstChild() != null) {
+			MobyDataType mdt = new MobyDataType (children.item (i).getFirstChild().getNodeValue());
+			NamedNodeMap map = (children.item (i).getAttributes());
+			if (map != null) {
+				Node node = map.getNamedItemNS(children.item(i).getNamespaceURI(),"lsid");
+				if (node != null)
+					mdt.setLSID(node.getNodeValue());
+			}
+			setDataType (mdt);
+		}
 	    } else if (childName.equals ("Namespace")) {
-		if (children.item (i).getFirstChild() != null)
-		    addNamespace (new MobyNamespace (children.item (i).getFirstChild().getNodeValue()));
+		if (children.item (i).getFirstChild() != null) {
+			MobyNamespace namespace = new MobyNamespace (children.item(i).getFirstChild().getNodeValue());
+			NamedNodeMap map = (children.item (i).getAttributes());
+			if (map != null) {
+				Node node = map.getNamedItemNS(children.item(i).getNamespaceURI(),"lsid");
+				if (node != null)
+					namespace.setLSID(node.getNodeValue());
+			}
+			addNamespace (namespace);
+		}
 	    }
 	}
     }




More information about the MOBY-guts mailing list