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