/**
 * <!-- LICENSE_TEXT_START -->
 * <!-- LICENSE_TEXT_END -->
 */
package gov.nih.nci.caadapter.hl7.datatype;

import java.util.Collections;
import java.util.List;

/**
 * The class provides Utilities to access the Datatype info.
 *
 * @author OWNER: Ye Wu
 * @author LAST UPDATE $Author: wangeug $
 * @version Since caAdapter v4.0
 *          revision    $Revision: 1.2 $
 *          date        $Date: 2007-07-03 18:25:43 $
 */
public class DatatypeParserUtil {
	private static DatatypeParser datatypeParser = null;
	private DatatypeParserUtil() {}
	public static DatatypeParser getDatatypeParser() {
	  try {
		if (datatypeParser == null) {
			datatypeParser = new DatatypeParser();
			datatypeParser.loadDatatypes();
		}
	  }catch(Exception e) {
		  e.printStackTrace();
	  }
		return datatypeParser;
	}
	public static Datatype getDatatype(String name) {
		DatatypeParser datatypeParser = getDatatypeParser();
		if (datatypeParser.getDatatypes().get(name) == null) return null;
		return (Datatype)datatypeParser.getDatatypes().get(name);
	}
	public static List <String>findSubclassListWithTypeName(String className)
	{
		List <String>rtnList=getDatatypeParser().findSubclassList(className);  
		if (rtnList!=null)
			Collections.sort(rtnList);
		return rtnList;
	}
	
	public static boolean isAbstractDatatypeWithName(String typeName)
	{
		List subClassList=findSubclassListWithTypeName(typeName);
		if (subClassList==null||subClassList.isEmpty())
			return false;
		return true;
	}
}
@@ -364,17 +364,17 @@
 sion: 1.
-2
+3
  $%0A *   
@@ -409,21 +409,21 @@
 07-0
-7-03 18:25:43
+8-29 18:47:50
  $%0A 
@@ -854,16 +854,67 @@
 name) %7B%0A
+%09%09if (name==null%7C%7Cname.equals(%22%22))%0A%09%09%09return null;%0A
 %09%09Dataty

check null