Added Spring Java Conventions to all of the spring sub-projects and formatted them to meet the guidelines.

This commit is contained in:
Ben Hale
2007-08-13 16:16:51 +00:00
parent 2e4ed776c1
commit 67a05c196d
50 changed files with 119 additions and 139 deletions

View File

@@ -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");
}
}

View File

@@ -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
*/

View File

@@ -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());

View File

@@ -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
*/

View File

@@ -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