當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。