當前位置: 首頁>>代碼示例>>Java>>正文


Java ProcessorResult類代碼示例

本文整理匯總了Java中org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult的典型用法代碼示例。如果您正苦於以下問題:Java ProcessorResult類的具體用法?Java ProcessorResult怎麽用?Java ProcessorResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProcessorResult類屬於org.kuali.rice.krad.datadictionary.validation.result包,在下文中一共展示了ProcessorResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * Processes the SimpleConstraint by calling process on the other smaller constraints it represents and
 * putting the results together in ProcessorResult
 *
 * @return processor result
 * @throws AttributeValidationException
 * @see MandatoryElementConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, final SimpleConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    ProcessorResult dataTypePR = dataTypeConstraintProcessor.process(result, value, constraint,
            attributeValueReader);
    ProcessorResult existencePR = existenceConstraintProcessor.process(result, value, constraint,
            attributeValueReader);
    ProcessorResult rangePR = rangeConstraintProcessor.process(result, value, constraint, attributeValueReader);
    ProcessorResult lengthPR = lengthConstraintProcessor.process(result, value, constraint, attributeValueReader);
    List<ConstraintValidationResult> cvrList = new ArrayList<ConstraintValidationResult>();
    cvrList.addAll(existencePR.getConstraintValidationResults());
    cvrList.addAll(rangePR.getConstraintValidationResults());
    cvrList.addAll(lengthPR.getConstraintValidationResults());
    cvrList.addAll(dataTypePR.getConstraintValidationResults());
    return new ProcessorResult(cvrList);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:28,代碼來源:SimpleConstraintProcessor.java

示例2: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, PrerequisiteConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    if (ValidationUtils.isNullOrEmpty(value)) {
        return new ProcessorResult(result.addSkipped(attributeValueReader, CONSTRAINT_NAME));
    }

    ConstraintValidationResult constraintValidationResult = processPrerequisiteConstraint(constraint,
            attributeValueReader);

    if (constraint != null) {
        if (StringUtils.isNotBlank(constraint.getMessageKey())) {
            constraintValidationResult.setConstraintLabelKey(constraint.getMessageKey());
        } else {
            constraintValidationResult.setConstraintLabelKey(
                    UifConstants.Messages.VALIDATION_MSG_KEY_PREFIX + FALLBACK_KEY);
        }
        constraintValidationResult.setErrorParameters(constraint.getValidationMessageParamsArray());
    }

    result.addConstraintValidationResult(attributeValueReader, constraintValidationResult);

    return new ProcessorResult(constraintValidationResult);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:29,代碼來源:PrerequisiteConstraintProcessor.java

示例3: testCaseConstraintInvoked

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
@Test
public void testCaseConstraintInvoked() {
	ProcessorResult processorResult = processRaw(noStateAddress, "country", countryIsUSACaseConstraint);

	List<Constraint> constraints = processorResult.getConstraints();

	Assert.assertNotNull(constraints);
	Assert.assertEquals(1, constraints.size());

	Constraint constraint = constraints.get(0);

	Assert.assertTrue(constraint instanceof PrerequisiteConstraint);

	PrerequisiteConstraint prerequisiteConstraint = (PrerequisiteConstraint)constraint;

	Assert.assertEquals("state", prerequisiteConstraint.getPropertyName());

	ConstraintValidationResult result = processorResult.getFirstConstraintValidationResult();
	Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings());
	Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
	Assert.assertEquals(ErrorLevel.OK, result.getStatus());
	Assert.assertEquals(new CaseConstraintProcessor().getName(), result.getConstraintName());
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:24,代碼來源:CaseConstraintProcessorTest.java

示例4: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * Processes the SimpleConstraint by calling process on the other smaller constraints it represents and
 * putting the results together in ProcessorResult
 *
 * @return
 * @throws AttributeValidationException
 * @see MandatoryElementConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, final SimpleConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    ProcessorResult dataTypePR = dataTypeConstraintProcessor.process(result, value, constraint,
            attributeValueReader);
    ProcessorResult existencePR = existenceConstraintProcessor.process(result, value, constraint,
            attributeValueReader);
    ProcessorResult rangePR = rangeConstraintProcessor.process(result, value, constraint, attributeValueReader);
    ProcessorResult lengthPR = lengthConstraintProcessor.process(result, value, constraint, attributeValueReader);
    List<ConstraintValidationResult> cvrList = new ArrayList<ConstraintValidationResult>();
    cvrList.addAll(existencePR.getConstraintValidationResults());
    cvrList.addAll(rangePR.getConstraintValidationResults());
    cvrList.addAll(lengthPR.getConstraintValidationResults());
    cvrList.addAll(dataTypePR.getConstraintValidationResults());
    return new ProcessorResult(cvrList);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:28,代碼來源:SimpleConstraintProcessor.java

示例5: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.capability.Validatable,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, PrerequisiteConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    if (ValidationUtils.isNullOrEmpty(value)) {
        return new ProcessorResult(result.addSkipped(attributeValueReader, CONSTRAINT_NAME));
    }

    ConstraintValidationResult constraintValidationResult = processPrerequisiteConstraint(constraint,
            attributeValueReader);

    if (constraint != null) {
        if (StringUtils.isNotBlank(constraint.getMessageKey())) {
            constraintValidationResult.setConstraintLabelKey(constraint.getMessageKey());
        } else {
            constraintValidationResult.setConstraintLabelKey(
                    UifConstants.Messages.VALIDATION_MSG_KEY_PREFIX + FALLBACK_KEY);
        }
        constraintValidationResult.setErrorParameters(constraint.getValidationMessageParamsArray());
    }

    result.addConstraintValidationResult(attributeValueReader, constraintValidationResult);

    return new ProcessorResult(constraintValidationResult);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:31,代碼來源:PrerequisiteConstraintProcessor.java

示例6: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Collection<?> collection,
        CollectionSizeConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    // To accommodate the needs of other processors, the ConstraintProcessor.process() method returns a list of ConstraintValidationResult objects
    // but since a definition that is collection size constrained only provides a single max and minimum, there is effectively a single constraint
    // being imposed.
    return new ProcessorResult(processSingleCollectionSizeConstraint(result, collection, constraint,
            attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:17,代碼來源:CollectionSizeConstraintProcessor.java

示例7: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, DataTypeConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    DataType dataType = constraint.getDataType();

    return new ProcessorResult(processDataTypeConstraint(result, dataType, value, attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:14,代碼來源:DataTypeConstraintProcessor.java

示例8: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, RangeConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    // Since any given definition that is range constrained only expressed a single min and max, it means that there is only a single constraint to impose
    return new ProcessorResult(processSingleRangeConstraint(result, value, constraint, attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:RangeConstraintProcessor.java

示例9: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader) \
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, ExistenceConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    // To accommodate the needs of other processors, the ConstraintProcessor.process() method returns a list of ConstraintValidationResult objects
    // but since a definition that is existence constrained only provides a single isRequired field, there is effectively a single constraint
    // being imposed.
    return new ProcessorResult(processSingleExistenceConstraint(result, value, constraint, attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:ExistenceConstraintProcessor.java

示例10: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, LengthConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    // To accommodate the needs of other processors, the ConstraintProcessor.process() method returns a list of ConstraintValidationResult objects
    // but since a definition that is length constrained only constrains a single field, there is effectively always a single constraint
    // being imposed
    return new ProcessorResult(processSingleLengthConstraint(result, value, constraint, attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:LengthConstraintProcessor.java

示例11: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value, MustOccurConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    if (ValidationUtils.isNullOrEmpty(value)) {
        return new ProcessorResult(result.addSkipped(attributeValueReader, CONSTRAINT_NAME));
    }

    ConstraintValidationResult constraintValidationResult = new ConstraintValidationResult(CONSTRAINT_NAME);
    if (StringUtils.isNotBlank(constraint.getMessageKey())) {
        constraintValidationResult.setConstraintLabelKey(constraint.getMessageKey());
    } else {
        constraintValidationResult.setConstraintLabelKey(
                UifConstants.Messages.VALIDATION_MSG_KEY_PREFIX + FALLBACK_KEY);
    }

    constraintValidationResult.setErrorParameters(constraint.getValidationMessageParamsArray());

    // If the processing of this constraint is not successful then it's an error
    if (!processMustOccurConstraint(constraintValidationResult, constraint, attributeValueReader)) {
        // if attributeName is null, use the entry name since we are processing a must occur constraint that may be referencing multiple attributes
        if (attributeValueReader.getAttributeName() == null) {
            constraintValidationResult.setAttributeName(attributeValueReader.getEntryName());
        } else {
            constraintValidationResult.setAttributeName(attributeValueReader.getAttributeName());
            constraintValidationResult.setAttributePath(attributeValueReader.getPath());
        }
        constraintValidationResult.setError(RiceKeyConstants.ERROR_OCCURS);
    }

    // Store the label key (if one exists) for this constraint on the constraint validation result so it can be shown later

    // Add it to the DictionaryValidationResult object
    result.addConstraintValidationResult(attributeValueReader, constraintValidationResult);

    return new ProcessorResult(constraintValidationResult);

}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:44,代碼來源:MustOccurConstraintProcessor.java

示例12: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value,
        ValidCharactersConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    return new ProcessorResult(processSingleValidCharacterConstraint(result, value, constraint,
            attributeValueReader));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:12,代碼來源:ValidCharactersConstraintProcessor.java

示例13: processRaw

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
protected ProcessorResult processRaw(Object object, String attributeName, Constraint constraint) {
	AttributeValueReader attributeValueReader = new DictionaryObjectAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", addressEntry);
	attributeValueReader.setAttributeName(attributeName);

	Object value = attributeName != null ? attributeValueReader.getValue() : object;

	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:BaseConstraintProcessorTest.java

示例14: testCaseConstraintNotInvoked

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
@Test
public void testCaseConstraintNotInvoked() {
	ProcessorResult processorResult = processRaw(londonAddress, "country", countryIsUSACaseConstraint);
	ConstraintValidationResult result = processorResult.getFirstConstraintValidationResult();
	Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings());
	Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
	Assert.assertEquals(ErrorLevel.INAPPLICABLE, result.getStatus());
	Assert.assertEquals(new CaseConstraintProcessor().getName(), result.getConstraintName());

	List<Constraint> constraints = processorResult.getConstraints();

	Assert.assertNotNull(constraints);
	Assert.assertEquals(0, constraints.size());
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:CaseConstraintProcessorTest.java

示例15: process

import org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult; //導入依賴的package包/類
/**
 * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#process(DictionaryValidationResult,
 *      Object, org.kuali.rice.krad.datadictionary.validation.capability.Validatable,
 *      org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)
 */
@Override
public ProcessorResult process(DictionaryValidationResult result, Object value,
        ValidCharactersConstraint constraint,
        AttributeValueReader attributeValueReader) throws AttributeValidationException {

    return new ProcessorResult(processSingleValidCharacterConstraint(result, value, constraint,
            attributeValueReader));
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:14,代碼來源:ValidCharactersConstraintProcessor.java


注:本文中的org.kuali.rice.krad.datadictionary.validation.result.ProcessorResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。