本文整理汇总了Java中org.kuali.rice.kew.rule.RuleValidationAttribute类的典型用法代码示例。如果您正苦于以下问题:Java RuleValidationAttribute类的具体用法?Java RuleValidationAttribute怎么用?Java RuleValidationAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RuleValidationAttribute类属于org.kuali.rice.kew.rule包,在下文中一共展示了RuleValidationAttribute类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.kuali.rice.kew.rule.RuleValidationAttribute; //导入依赖的package包/类
@Override
public ValidationResults validate(String attributeName, RuleValidationContext validationContext) {
if (StringUtils.isBlank(attributeName)) {
throw new RiceIllegalArgumentException("attribute name was null or blank");
}
RuleValidationAttribute attr = loadAttribute(attributeName);
return attr.validate(validationContext);
}
示例2: loadAttribute
import org.kuali.rice.kew.rule.RuleValidationAttribute; //导入依赖的package包/类
/**
* Loads RuleValidationAttribute implementation class via {@link ExtensionRepositoryService}
* @param attributeName the RuleValidationAttribute name
* @return instance of the RuleValidationAttribute implementation class
* @throws RiceIllegalArgumentException if specified attribute name cannot be found or loaded
*/
protected RuleValidationAttribute loadAttribute(String attributeName) {
ExtensionDefinition extensionDefinition = getExtensionRepositoryService().getExtensionByName(attributeName);
if (extensionDefinition == null) {
throw new RiceIllegalArgumentException("Failed to locate a RuleValidationAttribute with the given name: " + attributeName);
}
RuleValidationAttribute attribute = ExtensionUtils.loadExtension(extensionDefinition);
if (attribute == null) {
throw new RiceIllegalArgumentException("Failed to load RuleValidationAttribute for: " + extensionDefinition);
}
return attribute;
}
示例3: resolveRuleValidationAttribute
import org.kuali.rice.kew.rule.RuleValidationAttribute; //导入依赖的package包/类
@Override
public RuleValidationAttribute resolveRuleValidationAttribute(final String attributeName, String applicationId) throws Exception {
final RuleValidationAttributeExporterService service = findRuleValidationAttributeExporterService(applicationId);
return (RuleValidationAttribute) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[] { RuleValidationAttribute.class }, new RuleValidationAttributeInvocationHandler() {
@Override
protected ValidationResults invokeValidate(RuleValidationContext context) throws Exception {
return service.validate(attributeName, context);
}
});
}
示例4: getRuleValidationAttribute
import org.kuali.rice.kew.rule.RuleValidationAttribute; //导入依赖的package包/类
/**
* Instantiates and returns a new instance of the RuleValidationAttribute class configured on this template.
* The calling code should be sure to call isRuleValidationAttribute first to verify the type of this attribute
* is that of a RuleValidationAttribute. Otherwise a RuntimeException will be thrown.
*/
public RuleValidationAttribute getRuleValidationAttribute() {
try {
RuleAttribute attrib = getRuleAttribute();
return KEWServiceLocator.getRuleValidationAttributeResolver().resolveRuleValidationAttribute(attrib.getName(), attrib.getApplicationId());
} catch (Exception e) {
throw new RuntimeException("Caught exception instantiating new " + getRuleAttribute().getResourceDescriptor(), e);
}
}
示例5: resolveRuleValidationAttribute
import org.kuali.rice.kew.rule.RuleValidationAttribute; //导入依赖的package包/类
/**
* Resolves the RuleValidationAttribute by name, possibly resulting in delegation over the KSB.
*
* @return a RuleValidationAttribute suitable (only) for invocation of #validate
*/
public RuleValidationAttribute resolveRuleValidationAttribute(String attributeName, String applicationId) throws Exception;