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


Java PropertyDefinition类代码示例

本文整理汇总了Java中org.kuali.rice.core.api.reflect.PropertyDefinition的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinition类的具体用法?Java PropertyDefinition怎么用?Java PropertyDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyDefinition类属于org.kuali.rice.core.api.reflect包,在下文中一共展示了PropertyDefinition类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertWorkflowAttributeDefinition

import org.kuali.rice.core.api.reflect.PropertyDefinition; //导入依赖的package包/类
/**
 * New for Rice 2.0
 */
public static AttributeDefinition convertWorkflowAttributeDefinition(WorkflowAttributeDefinition definition) {
    if (definition == null) {
        return null;
    }
    //KULRICE-7643
    ExtensionDefinition extensionDefinition = null;
    List<RuleAttribute> ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByClassName(definition.getAttributeName());
    if (ruleAttribute == null || ruleAttribute.isEmpty()) {
        extensionDefinition = KewApiServiceLocator.getExtensionRepositoryService().getExtensionByName(definition.getAttributeName());
    }else{
        //TODO: Should we do something more intelligent here? Rice 1.x returned only a single entry but we can now have a list
        RuleAttribute tmpAttr = ruleAttribute.get(0);
        extensionDefinition = RuleAttribute.to(tmpAttr);
        if(ruleAttribute.size() > 1){
            LOG.warn("AttributeDefinition lookup (findByClassName) returned multiple attribute for the same class name. This should not happen, investigation recommended for classname: " 
        + definition.getAttributeName() + " which has " + ruleAttribute.size() + " entries.");
        }
    }
    
    if (extensionDefinition == null) {
        throw new WorkflowRuntimeException("Extension " + definition.getAttributeName() + " not found");
    }
    /*RuleAttribute ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByName(definition.getAttributeName());
    if (ruleAttribute == null) {
        throw new WorkflowRuntimeException("Attribute " + definition.getAttributeName() + " not found");
    }*/

    ObjectDefinition objectDefinition = new ObjectDefinition(extensionDefinition.getResourceDescriptor());
    if (definition.getParameters() != null) {
        for (String parameter : definition.getParameters()) {
            objectDefinition.addConstructorParameter(new DataDefinition(parameter, String.class));
        }
    }
    boolean propertiesAsMap = KewApiConstants.RULE_XML_ATTRIBUTE_TYPE.equals(extensionDefinition.getType()) || KewApiConstants
            .SEARCHABLE_XML_ATTRIBUTE_TYPE.equals(extensionDefinition.getType());
    if (!propertiesAsMap && definition.getPropertyDefinitions() != null) {
        for (org.kuali.rice.kew.api.document.PropertyDefinition propertyDefinition : definition
                .getPropertyDefinitions()) {
            objectDefinition.addProperty(new PropertyDefinition(propertyDefinition.getName(), new DataDefinition(
                    propertyDefinition.getValue(), String.class)));
        }
    }

    return new AttributeDefinition(extensionDefinition, objectDefinition);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:49,代码来源:DTOConverter.java

示例2: invokeProperties

import org.kuali.rice.core.api.reflect.PropertyDefinition; //导入依赖的package包/类
protected static void invokeProperties(Object object, Collection<PropertyDefinition> properties) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
	for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
		PropertyDefinition propertyDef = (PropertyDefinition) iterator.next();
		invokeProperty(object, propertyDef);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:ObjectDefinitionResolver.java

示例3: invokeProperty

import org.kuali.rice.core.api.reflect.PropertyDefinition; //导入依赖的package包/类
protected static void invokeProperty(Object object, PropertyDefinition definition) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
	PropertyUtils.setProperty(object, definition.getName(), definition.getData().getValue());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:ObjectDefinitionResolver.java


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