Added Spring Java Conventions to all of the spring sub-projects and formatted them to meet the guidelines.
This commit is contained in:
@@ -26,8 +26,8 @@ public class SearchCriteriaValidator implements Validator {
|
||||
}
|
||||
|
||||
public void validate(Object obj, Errors errors) {
|
||||
SearchCriteria query = (SearchCriteria)obj;
|
||||
if (!StringUtils.hasText(query.getFirstName()) && !StringUtils.hasText(query.getLastName())) {
|
||||
SearchCriteria query = (SearchCriteria) obj;
|
||||
if (!StringUtils.hasText(query.getFirstName()) && !StringUtils.hasText(query.getLastName())) {
|
||||
errors.reject("noCriteria", "Please provide valid search criteria");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.springframework.webflow.engine.builder.FlowBuilderException;
|
||||
import org.springframework.webflow.engine.support.ConfigurableFlowAttributeMapper;
|
||||
|
||||
/**
|
||||
* Java-based flow builder that builds the person details flow, exactly like it
|
||||
* is defined in the <code>detail-flow.xml</code> XML flow definition.
|
||||
* Java-based flow builder that builds the person details flow, exactly like it is defined in the
|
||||
* <code>detail-flow.xml</code> XML flow definition.
|
||||
* <p>
|
||||
* This encapsulates the page flow of viewing a person's details and their
|
||||
* collegues in a reusable, self-contained module.
|
||||
* This encapsulates the page flow of viewing a person's details and their collegues in a reusable, self-contained
|
||||
* module.
|
||||
*
|
||||
* @author Keith Donald
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.webflow.engine.builder.AbstractFlowBuilderFlowRegistr
|
||||
* @author Keith Donald
|
||||
*/
|
||||
public class PhonebookFlowRegistryFactoryBean extends AbstractFlowBuilderFlowRegistryFactoryBean {
|
||||
|
||||
|
||||
protected void doPopulate(FlowDefinitionRegistry registry) {
|
||||
registerFlowDefinition(registry, "detail-flow", new PersonDetailFlowBuilder());
|
||||
registerFlowDefinition(registry, "search-flow", new SearchPersonFlowBuilder());
|
||||
|
||||
@@ -26,13 +26,11 @@ import org.springframework.webflow.samples.phonebook.SearchCriteria;
|
||||
import org.springframework.webflow.samples.phonebook.SearchCriteriaValidator;
|
||||
|
||||
/**
|
||||
* Java-based flow builder that searches for people in the phonebook. The flow
|
||||
* defined by this class is exactly the same as that defined in the
|
||||
* <code>search-flow.xml</code> XML flow definition.
|
||||
* Java-based flow builder that searches for people in the phonebook. The flow defined by this class is exactly the same
|
||||
* as that defined in the <code>search-flow.xml</code> XML flow definition.
|
||||
* <p>
|
||||
* This encapsulates the page flow of searching for some people, selecting a
|
||||
* person you care about, and viewing their person's details and those of their
|
||||
* collegues in a reusable, self-contained module.
|
||||
* This encapsulates the page flow of searching for some people, selecting a person you care about, and viewing their
|
||||
* person's details and those of their collegues in a reusable, self-contained module.
|
||||
*
|
||||
* @author Keith Donald
|
||||
*/
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests {
|
||||
|
||||
@Override
|
||||
protected FlowDefinitionResource getFlowDefinitionResource() {
|
||||
return createFlowDefinitionResource("src/main/webapp/WEB-INF/flows/search-flow.xml");
|
||||
return createFlowDefinitionResource("src/main/webapp/WEB-INF/flows/search-flow.xml");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,7 +80,8 @@ public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests {
|
||||
Flow mockDetailFlow = new Flow("detail-flow");
|
||||
mockDetailFlow.setInputMapper(new AttributeMapper() {
|
||||
public void map(Object source, Object target, MappingContext context) {
|
||||
assertEquals("id of value 1 not provided as input by calling search flow", new Long(1), ((AttributeMap)source).get("id"));
|
||||
assertEquals("id of value 1 not provided as input by calling search flow", new Long(1),
|
||||
((AttributeMap) source).get("id"));
|
||||
}
|
||||
});
|
||||
// test responding to finish result
|
||||
|
||||
Reference in New Issue
Block a user