package cn.com.origin.autocodemanager.common;

import com.teamcenter.rac.kernel.TCComponentListOfValues;
import com.teamcenter.rac.kernel.TCComponentListOfValuesType;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;

public class TCLOVUtil {


	public static TCComponentListOfValues findLOVByName(TCSession tcsession, String s) {
		TCComponentListOfValues tccomponentlistofvalues = null;
		try {
			TCComponentListOfValuesType tccomponentlistofvaluestype = (TCComponentListOfValuesType) tcsession.getTypeComponent("ListOfValues");
			TCComponentListOfValues atccomponentlistofvalues[] = tccomponentlistofvaluestype.find(s);
			if (atccomponentlistofvalues != null && atccomponentlistofvalues.length > 0)
				tccomponentlistofvalues = atccomponentlistofvalues[0];
			else
				tccomponentlistofvalues = null;
		} catch (TCException tcexception) {
			tccomponentlistofvalues = null;
		}
		return tccomponentlistofvalues;
	}
	
}
