Java Code Examples for org.springframework.tests.sample.beans.TestBean#getName()

The following examples show how to use org.springframework.tests.sample.beans.TestBean#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataBinderTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
public void validate(@Nullable Object obj, Errors errors) {
	TestBean tb = (TestBean) obj;
	if (tb.getAge() < 32) {
		errors.rejectValue("age", "TOO_YOUNG", "simply too young");
	}
	if (tb.getAge() % 2 == 0) {
		errors.rejectValue("age", "AGE_NOT_ODD", "your age isn't odd");
	}
	if (tb.getName() == null || !tb.getName().equals("Rod")) {
		errors.rejectValue("name", "NOT_ROD", "are you sure you're not Rod?");
	}
	if (tb.getTouchy() == null || !tb.getTouchy().equals(tb.getName())) {
		errors.reject("NAME_TOUCHY_MISMATCH", "name and touchy do not match");
	}
	if (tb.getAge() == 0) {
		errors.reject("GENERAL_ERROR", new String[] {"arg"}, "msg");
	}
}
 
Example 2
Source File: DataBinderTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
public void validate(@Nullable Object obj, Errors errors) {
	TestBean tb = (TestBean) obj;
	if (tb.getAge() < 32) {
		errors.rejectValue("age", "TOO_YOUNG", "simply too young");
	}
	if (tb.getAge() % 2 == 0) {
		errors.rejectValue("age", "AGE_NOT_ODD", "your age isn't odd");
	}
	if (tb.getName() == null || !tb.getName().equals("Rod")) {
		errors.rejectValue("name", "NOT_ROD", "are you sure you're not Rod?");
	}
	if (tb.getTouchy() == null || !tb.getTouchy().equals(tb.getName())) {
		errors.reject("NAME_TOUCHY_MISMATCH", "name and touchy do not match");
	}
	if (tb.getAge() == 0) {
		errors.reject("GENERAL_ERROR", new String[] {"arg"}, "msg");
	}
}
 
Example 3
Source File: DataBinderTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public void validate(Object obj, Errors errors) {
	TestBean tb = (TestBean) obj;
	if (tb.getAge() < 32) {
		errors.rejectValue("age", "TOO_YOUNG", "simply too young");
	}
	if (tb.getAge() % 2 == 0) {
		errors.rejectValue("age", "AGE_NOT_ODD", "your age isn't odd");
	}
	if (tb.getName() == null || !tb.getName().equals("Rod")) {
		errors.rejectValue("name", "NOT_ROD", "are you sure you're not Rod?");
	}
	if (tb.getTouchy() == null || !tb.getTouchy().equals(tb.getName())) {
		errors.reject("NAME_TOUCHY_MISMATCH", "name and touchy do not match");
	}
	if (tb.getAge() == 0) {
		errors.reject("GENERAL_ERROR", new String[] {"arg"}, "msg");
	}
}
 
Example 4
Source File: RedirectAttributesModelMapTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public String convert(TestBean source) {
	return "[" + source.getName() + "]";
}
 
Example 5
Source File: RedirectAttributesModelMapTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public String convert(TestBean source) {
	return "[" + source.getName() + "]";
}
 
Example 6
Source File: RedirectAttributesModelMapTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public String convert(TestBean source) {
	return "[" + source.getName() + "]";
}