/**
* 从对象的LOV属性上获取LOV
*/
public static TCComponentListOfValues getLOVFromRevisionProperty(TCComponentItemRevision reivision, String key) {
TCComponentListOfValues lov = null;
try {
String lovName = reivision.getTCProperty(key).getDescriptor().getLOV().getProperty("lov_name");
lov = TCComponentListOfValuesType.findLOVByName(lovName);
} catch (TCException e) {
e.printStackTrace();
}
return lov;
}
/**
* 显示值对应的真实值
*/
public static String getLOVRealValue(TCComponentListOfValues lov, String displayValue) {
String value = null;
try {
value = (lov.getListOfValues().getRealValue(displayValue) != null) ? (String) lov.getListOfValues().getRealValue(displayValue) : displayValue;
} catch (TCException e) {
e.printStackTrace();
}
return value;
}