package gov.nih.nci.caadapter.common.util;

import gov.nih.nci.caadapter.common.metadata.ObjectMetadata;

import java.util.LinkedHashMap;

public class Iso21090Util {
	
	public static ObjectMetadata resolveAttributeDatatype(LinkedHashMap metaHash, String typeName)
	{
		System.out.println("Iso21090Util.resolveAttributeDatatype()..search type:"+typeName);
		for (Object dtKey:metaHash.keySet())
		{
			Object dtMeta=metaHash.get(dtKey);
			if (dtMeta instanceof ObjectMetadata)
			{
				ObjectMetadata dtObjectMeta=(ObjectMetadata)dtMeta;
//				System.out.println("Iso21090Util.resolveAttributeDatatype()..objectName:"+dtObjectMeta.getName());
				if (dtObjectMeta.getName().equals(typeName))
					try {
						return (ObjectMetadata)dtObjectMeta.clone(false);
					} catch (CloneNotSupportedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
			}
		}
		return null;
		
	}

}

@@ -168,18 +168,165 @@
 til %7B%0D%0A%09
+/**%0D%0A%09 * If the attribute of an object is an ISO 21090 data type, find it and clone it%0D%0A%09 * @param metaHash%0D%0A%09 * @param typeName%0D%0A%09 * @return%0D%0A%09 */
 %0D%0A
-
 %09public 
@@ -422,97 +422,8 @@
 %09%7B%0D%0A
-%09%09System.out.println(%22Iso21090Util.resolveAttributeDatatype()..search type:%22+typeName);%0D%0A
 %09%09fo
@@ -550,16 +550,16 @@
 %0D%0A%09%09%09%7B%0D%0A
+
 %09%09%09%09Obje
@@ -611,114 +611,8 @@
 a;%0D%0A
-//%09%09%09%09System.out.println(%22Iso21090Util.resolveAttributeDatatype()..objectName:%22+dtObjectMeta.getName());%0D%0A
 %09%09%09%09

clean codes