本文整理汇总了Java中org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver.createObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDefinitionResolver.createObject方法的具体用法?Java ObjectDefinitionResolver.createObject怎么用?Java ObjectDefinitionResolver.createObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver
的用法示例。
在下文中一共展示了ObjectDefinitionResolver.createObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSearchableAttributeValueByDataTypeString
import org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver; //导入方法依赖的package包/类
public static SearchableAttributeValue getSearchableAttributeValueByDataTypeString(String dataType) {
SearchableAttributeValue returnableValue = null;
if (StringUtils.isBlank(dataType)) {
return returnableValue;
}
for (SearchableAttributeValue attValue : getSearchableAttributeValueObjectTypes())
{
if (dataType.equalsIgnoreCase(attValue.getAttributeDataType()))
{
if (returnableValue != null)
{
String errorMsg = "Found two SearchableAttributeValue objects with same data type string ('" + dataType + "' while ignoring case): " + returnableValue.getClass().getName() + " and " + attValue.getClass().getName();
LOG.error("getSearchableAttributeValueByDataTypeString() " + errorMsg);
throw new RuntimeException(errorMsg);
}
LOG.debug("getSearchableAttributeValueByDataTypeString() SearchableAttributeValue class name is " + attValue.getClass().getName() + "... ojbConcreteClassName is " + attValue.getOjbConcreteClass());
ObjectDefinition objDef = new ObjectDefinition(attValue.getClass());
returnableValue = (SearchableAttributeValue) ObjectDefinitionResolver.createObject(objDef, ClassLoaderUtils.getDefaultClassLoader(), false);
}
}
return returnableValue;
}
示例2: getSearchableAttributeValueObjectTypes
import org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver; //导入方法依赖的package包/类
public static List<SearchableAttributeValue> getSearchableAttributeValueObjectTypes() {
List<SearchableAttributeValue> searchableAttributeValueClasses = new ArrayList<SearchableAttributeValue>();
for (Class<? extends SearchableAttributeValue> searchAttributeValueClass : SEARCHABLE_ATTRIBUTE_BASE_CLASS_LIST) {
ObjectDefinition objDef = new ObjectDefinition(searchAttributeValueClass);
SearchableAttributeValue attributeValue = (SearchableAttributeValue) ObjectDefinitionResolver.createObject(
objDef, ClassLoaderUtils.getDefaultClassLoader(), false);
searchableAttributeValueClasses.add(attributeValue);
}
return searchableAttributeValueClasses;
}
示例3: createAction
import org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver; //导入方法依赖的package包/类
public ActionTakenEvent createAction(String actionCode, List<DataDefinition> parameters) throws ResourceUnavailableException {
String actionClassName = actionMap.get(actionCode);
if (actionClassName == null) {
throw new IllegalArgumentException("No action has been registered for the given action code of '" + actionCode + "'.");
}
ObjectDefinition actionDefinition = new ObjectDefinition(actionClassName);
if (parameters != null && !parameters.isEmpty()) {
actionDefinition.setConstructorParameters(parameters);
}
try {
//ActionTakenEvent actionTaken = (ActionTakenEvent)GlobalResourceLoader.getResourceLoader().getObject(actionDefinition);
// TODO ActionTakenEvent is not an interface so we can't fetch them through the GlobalResourceLoader, for now, just use
// the ObjectDefinitionResolver
ActionTakenEvent actionTaken = (ActionTakenEvent) ObjectDefinitionResolver.createObject(actionDefinition, ClassLoaderUtils.getDefaultClassLoader(), false);
if (actionTaken == null) {
// TODO the exception handling here is a bit wonky
throw new ResourceUnavailableException("Could not locate action taken class '" + actionClassName + "'");
}
return actionTaken;
} catch (Exception e) {
LOG.debug("createAction() Exception thrown while working with action class name '" + actionClassName + "'");
if (e instanceof ResourceUnavailableException) {
throw (ResourceUnavailableException)e;
}
throw new ResourceUnavailableException(e);
}
}