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


Java RuleValidationAttribute类代码示例

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

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

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

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

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


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