本文整理汇总了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);
}
示例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);
}
}
示例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());
}