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


Java AttributeDefinition.setValidCharactersConstraint方法代码示例

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


在下文中一共展示了AttributeDefinition.setValidCharactersConstraint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	postalCodeNumericPatternConstraint = new NumericPatternConstraint();
       postalCodeNumericPatternConstraint.setMessageKey("validate.dummykey");
       postalCodeNumericPatternConstraint.setValidationMessageParams( new ArrayList<String>());

	postalCodeDefinition = new AttributeDefinition();
	postalCodeDefinition.setName("postalCode");
	postalCodeDefinition.setValidCharactersConstraint(postalCodeNumericPatternConstraint);
	attributes.add(postalCodeDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:NumericPatternConstraintTest.java

示例2: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	postalCodePatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       postalCodePatternConstraint.setMessageKey("validate.dummykey");
       postalCodePatternConstraint.setValidationMessageParams( new ArrayList<String>());
	postalCodePatternConstraint.setValue(regex);

	postalCodeDefinition = new AttributeDefinition();
	postalCodeDefinition.setName("postalCode");
	postalCodeDefinition.setValidCharactersConstraint(postalCodePatternConstraint);
	attributes.add(postalCodeDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ZipcodePatternConstraintTest.java

示例3: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	validMonth = "1";
	validMonth1 = "05";
	validMonth2 = "12";
	invalidMonthEmpty = "";
	invalidMonth = "00";
	invalidMonth1 = "0";
	invalidMonth2 = "13";
	invalidMonth3 = "JAN";

	monthPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       monthPatternConstraint.setMessageKey("validate.dummykey");
       monthPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	monthPatternConstraint.setValue(regex);

	monthDefinition = new AttributeDefinition();
	monthDefinition.setName("month");
	monthDefinition.setValidCharactersConstraint(monthPatternConstraint);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:MonthPatternConstraintTest.java

示例4: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	validPhoneEmployee.setContactPhone("056-012-1200");
	invalidPhoneEmployeeEmpty.setContactPhone("");
	invalidPhoneEmployee.setContactPhone("09712248474");
	invalidPhoneEmployee1.setContactPhone("+19712248474");
	invalidPhoneEmployee2.setContactPhone("+1-972-232-3333");
	invalidPhoneEmployee3.setContactPhone("+1-(972)-23334444");
	invalidPhoneEmployee4.setContactPhone("+1-(972)-1223444 xtn.222");
	invalidPhoneEmployee5.setContactPhone("+1 056 012 1200");
	invalidPhoneEmployee6.setContactPhone("056\\-012\\-1200");

	contactPhoneNumberPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       contactPhoneNumberPatternConstraint.setMessageKey("validate.dummykey");
       contactPhoneNumberPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	contactPhoneNumberPatternConstraint.setValue(regex);

	contactPhoneDefinition = new AttributeDefinition();
	contactPhoneDefinition.setName("contactPhone");
	contactPhoneDefinition.setValidCharactersConstraint(contactPhoneNumberPatternConstraint);
	attributes.add(contactPhoneDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:PhoneNumberPatternConstraintTest.java

示例5: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	countryCharsetPatternConstraint = new CharsetPatternConstraint();
       countryCharsetPatternConstraint.setMessageKey("validate.dummykey");
       countryCharsetPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	countryCharsetPatternConstraint.setValidChars("USA");

	countryDefinition = new AttributeDefinition();
	countryDefinition.setName("country");
	countryDefinition.setValidCharactersConstraint(countryCharsetPatternConstraint);
	attributes.add(countryDefinition);


	postalCodeCharsetPatternConstraint = new CharsetPatternConstraint();
       countryCharsetPatternConstraint.setMessageKey("validate.dummykey");
       countryCharsetPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	postalCodeCharsetPatternConstraint.setValidChars("(ZH-123456)");

	postalCodeDefinition = new AttributeDefinition();
	postalCodeDefinition.setName("postalCode");
	postalCodeDefinition.setValidCharactersConstraint(postalCodeCharsetPatternConstraint);
	attributes.add(postalCodeDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:CharsetPatternConstraintTest.java

示例6: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	validYear = "1901";
	validYear1 = "2050";
	validYear2 = "1837";
	invalidYearEmpty = "";
	invalidYear = "00";
	invalidYear1 = "337";
	invalidYear2 = "2300";
	invalidYear3 = "99999";

	yearPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       yearPatternConstraint.setMessageKey("validate.dummykey");
       yearPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	yearPatternConstraint.setValue(regex);

	yearDefinition = new AttributeDefinition();
	yearDefinition.setName("year");
	yearDefinition.setValidCharactersConstraint(yearPatternConstraint);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:YearPatternConstraintTest.java

示例7: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	validTimestamp = "2011-07-28 15:10:36.300";
	validTimestamp1 = "1936-07-28 15:10:36.9999999";
	invalidTimestampEmpty = "";
	invalidTimestamp = "2011/07/28 15:10:36.300";
	invalidTimestamp1 = "2011-07-28 15:10:36.300 IST";
	invalidTimestamp2 = "2011-07-28";
	invalidTimestamp3 = "28-07-2011 15:10:36.300";

	timestampPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       timestampPatternConstraint.setMessageKey("validate.dummykey");
       timestampPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	timestampPatternConstraint.setValue(regex);

	timestampDefinition = new AttributeDefinition();
	timestampDefinition.setName("timestamp");
	timestampDefinition.setValidCharactersConstraint(timestampPatternConstraint);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:TimestampPatternConstraintTest.java

示例8: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	street1AnyCharacterPatternConstraint = new AnyCharacterPatternConstraint();
       street1AnyCharacterPatternConstraint.setMessageKey("validate.dummykey");
       street1AnyCharacterPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	street1AnyCharacterPatternConstraint.setAllowWhitespace(true);

	street1Definition = new AttributeDefinition();
	street1Definition.setName("street1");
	street1Definition.setValidCharactersConstraint(street1AnyCharacterPatternConstraint);
	attributes.add(street1Definition);


	street2AnyCharacterPatternConstraint = new AnyCharacterPatternConstraint();
       street2AnyCharacterPatternConstraint.setMessageKey("validate.dummykey");
       street2AnyCharacterPatternConstraint.setValidationMessageParams( new ArrayList<String>());

	street2Definition = new AttributeDefinition();
	street2Definition.setName("street2");
	street2Definition.setValidCharactersConstraint(street2AnyCharacterPatternConstraint);
	attributes.add(street2Definition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:AnyCharacterPatternConstraintTest.java

示例9: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	validJavaClass = Integer.class.getName();
	validJavaClass1 = "org.kuali.rice.krad.datadictionary.validation.constraint.JavaClassPattternConstraintTest";
	validJavaClass2 = "String";
	invalidJavaClassEmpty = "";
	invalidJavaClass = "123.mypackage.com";
	invalidJavaClass1 = "mypackage.com.";
	invalidJavaClass2 = "123 mypackage";
	invalidJavaClass3 = "something.mypackage:com";

	javaClassPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       javaClassPatternConstraint.setMessageKey("validate.dummykey");
       javaClassPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	javaClassPatternConstraint.setValue(regex);

	javaClassDefinition = new AttributeDefinition();
	javaClassDefinition.setName("javaClass");
	javaClassDefinition.setValidCharactersConstraint(javaClassPatternConstraint);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:JavaClassPatternConstraintTest.java

示例10: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String formats = "MM/dd/yy;MM/dd/yyyy;MM-dd-yy;MM-dd-yyyy";

	Properties props = new Properties();
	props.put(CoreConstants.STRING_TO_DATE_FORMATS, formats);
	Config config = new SimpleConfig(props);

	ConfigContext.init(config);
	ConfigContext.getCurrentContextConfig().putProperty(CoreConstants.STRING_TO_DATE_FORMATS, formats);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	validDate = "07-28-2011";
	validDate1 = "12-31-83";
	invalidDateEmpty = "";
	invalidDate = "31-12-2010";
	invalidDate1 = "31-12-2010 12:30:45.456";
	invalidDate2 = "2011-07-28 IST";
	invalidDate3 = "12/31/2011";

	List<String> allowedFormats = new ArrayList<String>();
	allowedFormats.add("MM-dd-yy");
	allowedFormats.add("MM-dd-yyyy");

	datePatternConstraint = new DatePatternConstraint();
       datePatternConstraint.setMessageKey("validate.dummykey");
       datePatternConstraint.setValidationMessageParams( new ArrayList<String>());
	datePatternConstraint.setAllowedFormats(allowedFormats);

	dateDefinition = new AttributeDefinition();
	dateDefinition.setName("date");
	dateDefinition.setValidCharactersConstraint(datePatternConstraint);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:DatePatternConstraintTest.java

示例11: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	cityAlphaPatternConstraint = new AlphaPatternConstraint();
       cityAlphaPatternConstraint.setMessageKey("validate.dummykey");
       cityAlphaPatternConstraint.setValidationMessageParams( new ArrayList<String>());

	cityDefinition = new AttributeDefinition();
	cityDefinition.setName("city");
	cityDefinition.setValidCharactersConstraint(cityAlphaPatternConstraint);
	attributes.add(cityDefinition);

	street1AlphaPatternConstraint = new AlphaPatternConstraint();
       street1AlphaPatternConstraint.setMessageKey("validate.dummykey");
       street1AlphaPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	street1AlphaPatternConstraint.setAllowWhitespace(true);

	street1Definition = new AttributeDefinition();
	street1Definition.setName("street1");
	street1Definition.setValidCharactersConstraint(street1AlphaPatternConstraint);
	attributes.add(street1Definition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:AlphaPatternConstraintTest.java

示例12: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	totalBalanceFloatingPointPatternConstraint = new FloatingPointPatternConstraint();
       totalBalanceFloatingPointPatternConstraint.setMessageKey("validate.dummykey");
       totalBalanceFloatingPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	totalBalanceFloatingPointPatternConstraint.setValue(regex);

	totalBalanceDefinition = new AttributeDefinition();
	totalBalanceDefinition.setName("totalBalance");
	totalBalanceDefinition.setValidCharactersConstraint(totalBalanceFloatingPointPatternConstraint);
	attributes.add(totalBalanceDefinition);

	debitBalanceFloatingPointPatternConstraint = new FloatingPointPatternConstraint();
       debitBalanceFloatingPointPatternConstraint.setMessageKey("validate.dummykey");
       debitBalanceFloatingPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	debitBalanceFloatingPointPatternConstraint.setValue("-?"+regex);
	debitBalanceFloatingPointPatternConstraint.setAllowNegative(true);

	debitBalanceDefinition = new AttributeDefinition();
	debitBalanceDefinition.setName("debitBalance");
	debitBalanceDefinition.setValidCharactersConstraint(debitBalanceFloatingPointPatternConstraint);
	attributes.add(debitBalanceDefinition);


	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:FloatingPointPatternConstraintTest.java

示例13: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	totalBalanceFixedPointPatternConstraint = new FixedPointPatternConstraint();
       totalBalanceFixedPointPatternConstraint.setMessageKey("validate.dummykey");
       totalBalanceFixedPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	totalBalanceFixedPointPatternConstraint.setPrecision(6);
	totalBalanceFixedPointPatternConstraint.setScale(2);

	totalBalanceDefinition = new AttributeDefinition();
	totalBalanceDefinition.setName("totalBalance");
	totalBalanceDefinition.setValidCharactersConstraint(totalBalanceFixedPointPatternConstraint);
	attributes.add(totalBalanceDefinition);

	debitBalanceFixedPointPatternConstraint = new FixedPointPatternConstraint();
       debitBalanceFixedPointPatternConstraint.setMessageKey("validate.dummykey");
       debitBalanceFixedPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	debitBalanceFixedPointPatternConstraint.setPrecision(6);
	debitBalanceFixedPointPatternConstraint.setScale(2);
	debitBalanceFixedPointPatternConstraint.setAllowNegative(true);

	debitBalanceDefinition = new AttributeDefinition();
	debitBalanceDefinition.setName("debitBalance");
	debitBalanceDefinition.setValidCharactersConstraint(debitBalanceFixedPointPatternConstraint);
	attributes.add(debitBalanceDefinition);

	creditBalanceFixedPointPatternConstraint = new FixedPointPatternConstraint();
       creditBalanceFixedPointPatternConstraint.setMessageKey("validate.dummykey");
       creditBalanceFixedPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	creditBalanceFixedPointPatternConstraint.setPrecision(0);
	creditBalanceFixedPointPatternConstraint.setScale(0);

	creditBalanceDefinition = new AttributeDefinition();
	creditBalanceDefinition.setName("creditBalance");
	creditBalanceDefinition.setValidCharactersConstraint(creditBalanceFixedPointPatternConstraint);
	attributes.add(creditBalanceDefinition);

	creditBalanceFixedPointPatternConstraint1 = new FixedPointPatternConstraint();
       creditBalanceFixedPointPatternConstraint1.setMessageKey("validate.dummykey");
       creditBalanceFixedPointPatternConstraint1.setValidationMessageParams( new ArrayList<String>());
	creditBalanceFixedPointPatternConstraint1.setPrecision(2);
	creditBalanceFixedPointPatternConstraint1.setScale(3);

	creditBalanceFixedPointPatternConstraint2 = new FixedPointPatternConstraint();
       creditBalanceFixedPointPatternConstraint2.setMessageKey("validate.dummykey");
       creditBalanceFixedPointPatternConstraint2.setValidationMessageParams( new ArrayList<String>());
	creditBalanceFixedPointPatternConstraint2.setPrecision(-2);
	creditBalanceFixedPointPatternConstraint2.setScale(-3);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:61,代码来源:FixedPointPatternConstraintTest.java

示例14: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	String regex = getProperty(PATTERN_CONSTRAINT);

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	validEmailEmployee.setContactEmail("[email protected]");
	validEmailEmployee1.setContactEmail("[email protected]");
	validEmailEmployee2.setContactEmail("[email protected]");
	validEmailEmployee3.setContactEmail("[email protected]");
	validEmailEmployee4.setContactEmail("[email protected]");
	validEmailEmployee5.setContactEmail("[email protected]");
	invalidEmailEmployeeEmpty.setContactEmail("");
	invalidEmailEmployee.setContactEmail("@a.b.c.org");
	invalidEmailEmployee1.setContactEmail("a");
	invalidEmailEmployee2.setContactEmail("[email protected]");
	invalidEmailEmployee3.setContactEmail("[email protected]");
	invalidEmailEmployee4.setContactEmail("[email protected]");
	invalidEmailEmployee5.setContactEmail("[email protected]");
	invalidEmailEmployee6.setContactEmail("[email protected]");
	invalidEmailEmployee7.setContactEmail("[email protected]");

	contactEmailAddressPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
       contactEmailAddressPatternConstraint.setMessageKey("validate.dummykey");
       contactEmailAddressPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	contactEmailAddressPatternConstraint.setValue(regex);

	contactEmailDefinition = new AttributeDefinition();
	contactEmailDefinition.setName("contactEmail");
	contactEmailDefinition.setValidCharactersConstraint(contactEmailAddressPatternConstraint);
	attributes.add(contactEmailDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:43,代码来源:EmailAddressPatternConstraintTest.java

示例15: setUp

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

	processor = new ValidCharactersConstraintProcessor();

	dictionaryValidationResult = new DictionaryValidationResult();
	dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

	addressEntry = new BusinessObjectEntry();

	List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

	street1AlphaNumericPatternConstraint = new AlphaNumericPatternConstraint();
       street1AlphaNumericPatternConstraint.setMessageKey("validate.dummykey");
       street1AlphaNumericPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	street1AlphaNumericPatternConstraint.setAllowWhitespace(true);

	street1Definition = new AttributeDefinition();
	street1Definition.setName("street1");
	street1Definition.setValidCharactersConstraint(street1AlphaNumericPatternConstraint);
	attributes.add(street1Definition);


	street2AlphaNumericPatternConstraint = new AlphaNumericPatternConstraint();
       street2AlphaNumericPatternConstraint.setMessageKey("validate.dummykey");
       street2AlphaNumericPatternConstraint.setValidationMessageParams( new ArrayList<String>());
	street2AlphaNumericPatternConstraint.setAllowWhitespace(true);
	street2AlphaNumericPatternConstraint.setAllowParenthesis(true);
	street2AlphaNumericPatternConstraint.setAllowPeriod(true);
	street2AlphaNumericPatternConstraint.setAllowUnderscore(true);

	street2Definition = new AttributeDefinition();
	street2Definition.setName("street2");
	street2Definition.setValidCharactersConstraint(street2AlphaNumericPatternConstraint);
	attributes.add(street2Definition);

	postalCodeAlphaNumericPatternConstraint = new AlphaNumericPatternConstraint();
       postalCodeAlphaNumericPatternConstraint.setMessageKey("validate.dummykey");
       postalCodeAlphaNumericPatternConstraint.setValidationMessageParams( new ArrayList<String>());

	postalCodeDefinition = new AttributeDefinition();
	postalCodeDefinition.setName("postalCode");
	postalCodeDefinition.setValidCharactersConstraint(postalCodeAlphaNumericPatternConstraint);
	attributes.add(postalCodeDefinition);

	addressEntry.setAttributes(attributes);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:48,代码来源:AlphaNumericPatternConstraintTest.java


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