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


Java SingleAttributeValueReader类代码示例

本文整理汇总了Java中org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader的典型用法代码示例。如果您正苦于以下问题:Java SingleAttributeValueReader类的具体用法?Java SingleAttributeValueReader怎么用?Java SingleAttributeValueReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SingleAttributeValueReader类属于org.kuali.rice.krad.datadictionary.validation包,在下文中一共展示了SingleAttributeValueReader类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPresenceOfRequiredSingleAttributeSuccess

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testPresenceOfRequiredSingleAttributeSuccess() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(noPostalCodeAddress.getCity(),
            "org.kuali.rice.kns.datadictionary.validation.MockAddress", "city", cityRequiredDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    // This means that we do track everything above and including 'ok' results
    dictionaryValidationResult.setErrorLevel(ErrorLevel.OK);
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            cityRequiredDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is OK
    Assert.assertEquals(ErrorLevel.OK, constraintValidationResult.getStatus());
    Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:ExistenceConstraintProcessorTest.java

示例2: testPresenceNotRequiredSingleAttributeSuccess

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testPresenceNotRequiredSingleAttributeSuccess() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(noPostalCodeAddress.getCountry(),
            "org.kuali.rice.kns.datadictionary.validation.MockAddress", "country", countryNotRequiredDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    // This means that we do track everything above and including 'ok' results
    dictionaryValidationResult.setErrorLevel(ErrorLevel.OK);
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            countryNotRequiredDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is OK
    Assert.assertEquals(ErrorLevel.INAPPLICABLE, constraintValidationResult.getStatus());
    Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:ExistenceConstraintProcessorTest.java

示例3: testAbsenceNotRequiredSingleAttributeSuccess

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testAbsenceNotRequiredSingleAttributeSuccess() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(
            noPostalCodeOrCountryAddress.getCountry(), "org.kuali.rice.kns.datadictionary.validation.MockAddress",
            "country", countryNotRequiredDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    // This means that we do track everything above and including 'ok' results
    dictionaryValidationResult.setErrorLevel(ErrorLevel.OK);
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            countryNotRequiredDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is OK
    Assert.assertEquals(ErrorLevel.INAPPLICABLE, constraintValidationResult.getStatus());
    Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ExistenceConstraintProcessorTest.java

示例4: testPresenceNoConstraintSingleAttributeSuccess

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testPresenceNoConstraintSingleAttributeSuccess() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(noPostalCodeAddress.getCountry(),
            "org.kuali.rice.kns.datadictionary.validation.MockAddress", "country", countryNoConstraintDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    // This means that we do track everything above and including 'ok' results
    dictionaryValidationResult.setErrorLevel(ErrorLevel.OK);
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            countryNoConstraintDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is OK
    Assert.assertEquals(ErrorLevel.NOCONSTRAINT, constraintValidationResult.getStatus());
    Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:ExistenceConstraintProcessorTest.java

示例5: testAbsenceNoConstraintSingleAttributeSuccess

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testAbsenceNoConstraintSingleAttributeSuccess() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(
            noPostalCodeOrCountryAddress.getCountry(), "org.kuali.rice.kns.datadictionary.validation.MockAddress",
            "country", countryNoConstraintDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    // This means that we do track everything above and including 'ok' results
    dictionaryValidationResult.setErrorLevel(ErrorLevel.OK);
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            countryNoConstraintDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is OK
    Assert.assertEquals(ErrorLevel.NOCONSTRAINT, constraintValidationResult.getStatus());
    Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ExistenceConstraintProcessorTest.java

示例6: testAbsenceOfRequiredSingleAttributeFailure

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
@Test
public void testAbsenceOfRequiredSingleAttributeFailure() {
    AttributeValueReader attributeValueReader = new SingleAttributeValueReader(noPostalCodeOrCityAddress.getCity(),
            "org.kuali.rice.kns.datadictionary.validation.MockAddress", "city", cityRequiredDefinition);
    Object value = attributeValueReader.getValue();
    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    ConstraintValidationResult constraintValidationResult = processor.process(dictionaryValidationResult, value,
            cityRequiredDefinition.getSimpleConstraint(), attributeValueReader)
            .getFirstConstraintValidationResult();

    // Make sure that the constraint we were looking for got run
    Assert.assertEquals(new ExistenceConstraintProcessor().getName(),
            constraintValidationResult.getConstraintName());
    // Make sure that it's status is ERROR
    Assert.assertEquals(ErrorLevel.ERROR, constraintValidationResult.getStatus());
    Assert.assertEquals(1, dictionaryValidationResult.getNumberOfErrors());
    Assert.assertEquals(RiceKeyConstants.ERROR_REQUIRED, constraintValidationResult.getErrorKey());

    // Make sure that the iterator works too
    int countConstraints = 0;
    if (dictionaryValidationResult.getNumberOfErrors() > 0) {
        for (Iterator<ConstraintValidationResult> iterator = dictionaryValidationResult.iterator();
             iterator.hasNext(); ) {
            ConstraintValidationResult r = iterator.next();
            if (r.getStatus().getLevel() >= ErrorLevel.WARN.getLevel()) {
                countConstraints++;
            }
        }
    }
    Assert.assertEquals(1, countConstraints);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:ExistenceConstraintProcessorTest.java

示例7: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
protected ConstraintValidationResult process(DictionaryValidationResult result, Object value, DataTypeConstraint constraint) {
	AttributeDefinition definition = new AttributeDefinition();
	definition.setName("testAttribute");
	attributeValueReader = new SingleAttributeValueReader(value, "testEntry", "testAttribute", definition);
	return processor.process(result, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:DataTypeConstraintProcessorTest.java

示例8: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
private ConstraintValidationResult process(Object object, String attributeName, ValidCharactersConstraint constraint) {
	AttributeValueReader attributeValueReader = new SingleAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", attributeName,  monthDefinition);
	Object value = attributeValueReader.getValue();
	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:MonthPatternConstraintTest.java

示例9: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
private ConstraintValidationResult process(Object object, String attributeName, ValidCharactersConstraint constraint) {
	AttributeValueReader attributeValueReader = new SingleAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", attributeName,  yearDefinition);
	Object value = attributeValueReader.getValue();
	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:YearPatternConstraintTest.java

示例10: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
private ConstraintValidationResult process(Object object, String attributeName, ValidCharactersConstraint constraint) {
	AttributeValueReader attributeValueReader = new SingleAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", attributeName,  timestampDefinition);
	Object value = attributeValueReader.getValue();
	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:TimestampPatternConstraintTest.java

示例11: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
private ConstraintValidationResult process(Object object, String attributeName, ValidCharactersConstraint constraint) {
	AttributeValueReader attributeValueReader = new SingleAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", attributeName,  javaClassDefinition);
	Object value = attributeValueReader.getValue();
	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:JavaClassPatternConstraintTest.java

示例12: process

import org.kuali.rice.krad.datadictionary.validation.SingleAttributeValueReader; //导入依赖的package包/类
private ConstraintValidationResult process(Object object, String attributeName, ValidCharactersConstraint constraint) {
	AttributeValueReader attributeValueReader = new SingleAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.MockAddress", attributeName,  dateDefinition);
	Object value = attributeValueReader.getValue();
	return processor.process(dictionaryValidationResult, value, constraint, attributeValueReader).getFirstConstraintValidationResult();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:DatePatternConstraintTest.java


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