/**
* Get a property editor given a property type.
*
* @param propertyType The property type to look up an editor for.
* @param path The property path, if applicable.
* @return property editor
*/
public static PropertyEditor getPropertyEditor(Class<?> propertyType) {
PropertyEditorRegistry registry = getPropertyEditorRegistry();
PropertyEditor editor = null;
if (registry != null) {
editor = registry.findCustomEditor(propertyType, null);
} else {
DataDictionaryService dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService();
Map<Class<?>, String> editorMap = dataDictionaryService.getPropertyEditorMap();
String editorPrototypeName = editorMap == null ? null : editorMap.get(propertyType);
if (editorPrototypeName != null) {
editor = (PropertyEditor) dataDictionaryService.getDataDictionary().getDictionaryPrototype(editorPrototypeName);
}
}
if (editor == null && propertyType != null) {
// Fall back to default beans lookup
editor = PropertyEditorManager.findEditor(propertyType);
}
return editor;
}
ObjectPropertyUtils.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:kc-rice
作者:
评论列表
文章目录