From 22bdf88ad305ea22b00db04ce8df1710f657ad70 Mon Sep 17 00:00:00 2001 From: Erwin Vervaet Date: Wed, 9 May 2007 09:42:29 +0000 Subject: [PATCH] Added initBuilder() hook method to AbstractFlowBuilder. --- spring-webflow/changelog.txt | 1 + .../webflow/engine/builder/AbstractFlowBuilder.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/spring-webflow/changelog.txt b/spring-webflow/changelog.txt index f4b827b1..0f384a57 100644 --- a/spring-webflow/changelog.txt +++ b/spring-webflow/changelog.txt @@ -23,6 +23,7 @@ Package org.springframework.webflow.conversation Package org.springframework.webflow.engine * Added invoke(String, Action) method to AbstractFlowBuilder. +* Added initBuilder() hook method to AbstractFlowBuilder. Package org.springframework.webflow.execution * Added a holder for the FlowExecutionContext of a request (SWF-163). diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java index d4e04726..9326581e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java @@ -185,6 +185,7 @@ public abstract class AbstractFlowBuilder extends BaseFlowBuilder { public void init(String flowId, AttributeMap attributes) throws FlowBuilderException { setFlow(getFlowArtifactFactory().createFlow(flowId, flowAttributes().union(attributes))); + initBuilder(); } /** @@ -196,6 +197,15 @@ public abstract class AbstractFlowBuilder extends BaseFlowBuilder { protected AttributeMap flowAttributes() { return CollectionUtils.EMPTY_ATTRIBUTE_MAP; } + + /** + * Hook method subclasses can override to initialize the flow builder. + * Will be called by {@link #init(String, AttributeMap)} after + * creating the initial Flow object. As a consequence, {@link #getFlow()} + * can be called to retrieve the Flow object under construction. + */ + protected void initBuilder() { + } // view state