Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.kew.validation;
RuleValidationAttributeExporterService reference impl. Delegates to the ExtensionRepositoryService to load the custom RuleValidationAttribute.

Kuali Rice Team (
    private static final Logger LOG = Logger.getLogger(RuleValidationAttributeExporterServiceImpl.class);
    public void setExtensionRepositoryService(ExtensionRepositoryService extensionRepositoryService) {
        this. = extensionRepositoryService;
        return this.;
    public ValidationResults validate(String attributeNameRuleValidationContext validationContext) {
        if (StringUtils.isBlank(attributeName)) {
            throw new RiceIllegalArgumentException("attribute name was null or blank");
        RuleValidationAttribute attr = loadAttribute(attributeName);
        return attr.validate(validationContext);

Loads RuleValidationAttribute implementation class via org.kuali.rice.kew.api.extension.ExtensionRepositoryService

attributeName the RuleValidationAttribute name
instance of the RuleValidationAttribute implementation class
org.kuali.rice.core.api.exception.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;
New to GrepCode? Check out our FAQ X