/**
* Helper method for getting the string value of a property from a {@link PropertyValues}
*
* @param propertyValues property values instance to pull from
* @param propertyName name of property whose value should be retrieved
* @return String value for property or null if property was not found
*/
public static String getStringValFromPVs(PropertyValues propertyValues, String propertyName) {
String propertyValue = null;
if ((propertyValues != null) && propertyValues.contains(propertyName)) {
Object pvValue = propertyValues.getPropertyValue(propertyName).getValue();
if (pvValue instanceof TypedStringValue) {
TypedStringValue typedStringValue = (TypedStringValue) pvValue;
propertyValue = typedStringValue.getValue();
} else if (pvValue instanceof String) {
propertyValue = (String) pvValue;
}
}
return propertyValue;
}
ViewModelUtils.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:kuali_rice
作者:
评论列表
文章目录