当前位置: 首页>>代码示例>>Java>>正文


Java ObjectDefinitionResolver.createObject方法代码示例

本文整理汇总了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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:DocumentSearchInternalUtils.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:DocumentSearchInternalUtils.java

示例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);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:ActionRegistryImpl.java


注:本文中的org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver.createObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。