diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractActionModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractActionModel.java index 22926cdd..123db88f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractActionModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractActionModel.java @@ -22,14 +22,6 @@ package org.springframework.webflow.engine.model; */ public abstract class AbstractActionModel extends AbstractModel { - /** - * Actions are not mergeable - * @param model the render action to merge into this render - */ - public void merge(Model model) { - // not mergeable - } - /** * Actions are not mergeable * @param model the model to test @@ -38,4 +30,12 @@ public abstract class AbstractActionModel extends AbstractModel { return false; } + /** + * Actions are not mergeable + * @param model the render action to merge into this render + */ + public void merge(Model model) { + // not mergeable + } + } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ActionStateModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ActionStateModel.java index 9afabae6..5545a6e5 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ActionStateModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ActionStateModel.java @@ -21,10 +21,6 @@ import org.springframework.util.ObjectUtils; /** * Model support for action states. - *

- * A state where one or more actions are executed. This state type is typically used to invoke application code. An - * action state is a transitionable state. A transition out of this state is driven by the result of action execution. - * * @author Scott Andrews */ public class ActionStateModel extends AbstractTransitionableStateModel { @@ -38,10 +34,14 @@ public class ActionStateModel extends AbstractTransitionableStateModel { setId(id); } - /** - * Merge properties - * @param model the action state to merge into this state - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof ActionStateModel)) { + return false; + } + ActionStateModel state = (ActionStateModel) model; + return ObjectUtils.nullSafeEquals(getId(), state.getId()); + } + public void merge(Model model) { ActionStateModel state = (ActionStateModel) model; setAttributes(merge(getAttributes(), state.getAttributes())); @@ -53,18 +53,6 @@ public class ActionStateModel extends AbstractTransitionableStateModel { setActions(merge(getActions(), state.getActions(), false)); } - /** - * Tests if the model is able to be merged with this action state - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof ActionStateModel)) { - return false; - } - ActionStateModel state = (ActionStateModel) model; - return ObjectUtils.nullSafeEquals(getId(), state.getId()); - } - /** * @return the actions */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AttributeModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AttributeModel.java index 2a80ae73..439841c4 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AttributeModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AttributeModel.java @@ -40,19 +40,6 @@ public class AttributeModel extends AbstractModel { setValue(value); } - /** - * Merge properties - * @param model the attribute to merge into this attribute - */ - public void merge(Model model) { - AttributeModel attribute = (AttributeModel) model; - setType(merge(getType(), attribute.getType())); - } - - /** - * Tests if the model is able to be merged with this attribute - * @param model the model to test - */ public boolean isMergeableWith(Model model) { if (!(model instanceof AttributeModel)) { return false; @@ -62,6 +49,11 @@ public class AttributeModel extends AbstractModel { && ObjectUtils.nullSafeEquals(getValue(), attribute.getValue()); } + public void merge(Model model) { + AttributeModel attribute = (AttributeModel) model; + setType(merge(getType(), attribute.getType())); + } + /** * @return the name */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/BeanImportModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/BeanImportModel.java index 6a575e4d..b2b44ba1 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/BeanImportModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/BeanImportModel.java @@ -36,20 +36,14 @@ public class BeanImportModel extends AbstractModel { setResource(resource); } - /** - * Bean imports are not mergeable - */ - public void merge(Model model) { - // not mergeable - } - - /** - * Bean imports are not mergeable - */ public boolean isMergeableWith(Model model) { return false; } + public void merge(Model model) { + + } + /** * @return the resource */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/DecisionStateModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/DecisionStateModel.java index 7d349bfd..57bd5c82 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/DecisionStateModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/DecisionStateModel.java @@ -21,13 +21,6 @@ import org.springframework.util.ObjectUtils; /** * Model support for decision states. - *

- * Evaluates one or more expressions to decide what state to transition to next. Intended to be used as an idempotent - * 'navigation' or 'routing' state. - *

- * A decision state is a transitionable state. A decision state transition can be triggered by evaluating a boolean - * expression against the flow execution request context. To define transition expressions, use the 'if' element. - * * @author Scott Andrews */ public class DecisionStateModel extends AbstractStateModel { @@ -42,10 +35,14 @@ public class DecisionStateModel extends AbstractStateModel { setId(id); } - /** - * Merge properties - * @param model the decision state to merge into this state - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof DecisionStateModel)) { + return false; + } + DecisionStateModel state = (DecisionStateModel) model; + return ObjectUtils.nullSafeEquals(getId(), state.getId()); + } + public void merge(Model model) { DecisionStateModel state = (DecisionStateModel) model; setAttributes(merge(getAttributes(), state.getAttributes())); @@ -56,18 +53,6 @@ public class DecisionStateModel extends AbstractStateModel { setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); } - /** - * Tests if the model is able to be merged with this decision state - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof DecisionStateModel)) { - return false; - } - DecisionStateModel state = (DecisionStateModel) model; - return ObjectUtils.nullSafeEquals(getId(), state.getId()); - } - /** * @return the ifs */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/EndStateModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/EndStateModel.java index 35b1ff0c..83ddd2d4 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/EndStateModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/EndStateModel.java @@ -22,15 +22,6 @@ import org.springframework.util.StringUtils; /** * Model support for end states. - *

- * A state that terminates this flow when entered. Defines a flow outcome. - *

- * An end state is not transitionable; there are never transitions out of an end state. When an end-state is entered, an - * instance of this flow is terminated. - *

- * When this flow terminates, if it was the "root" flow the entire execution is terminated. If this flow was a subflow, - * its parent flow resumes. - * * @author Scott Andrews */ public class EndStateModel extends AbstractStateModel { @@ -46,10 +37,14 @@ public class EndStateModel extends AbstractStateModel { setId(id); } - /** - * Merge properties - * @param model the end state to merge into this state - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof EndStateModel)) { + return false; + } + EndStateModel state = (EndStateModel) model; + return ObjectUtils.nullSafeEquals(getId(), state.getId()); + } + public void merge(Model model) { EndStateModel state = (EndStateModel) model; setAttributes(merge(getAttributes(), state.getAttributes())); @@ -61,18 +56,6 @@ public class EndStateModel extends AbstractStateModel { setOutputs(merge(getOutputs(), state.getOutputs(), false)); } - /** - * Tests if the model is able to be merged with this end state - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof EndStateModel)) { - return false; - } - EndStateModel state = (EndStateModel) model; - return ObjectUtils.nullSafeEquals(getId(), state.getId()); - } - /** * @return the view */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ExceptionHandlerModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ExceptionHandlerModel.java index f306d528..275bff56 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ExceptionHandlerModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ExceptionHandlerModel.java @@ -35,17 +35,13 @@ public class ExceptionHandlerModel extends AbstractModel { setBeanName(beanName); } - /** - * Exception handlers are not mergeable - */ - public void merge(Model model) { - // not mergable - } - public boolean isMergeableWith(Model model) { return false; } + public void merge(Model model) { + } + /** * @return the bean name */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/FlowModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/FlowModel.java index 56a71ab7..014329b5 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/FlowModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/FlowModel.java @@ -67,10 +67,14 @@ public class FlowModel extends AbstractModel { public FlowModel() { } - /** - * Merge properties - * @param model the flow to merge into this flow - */ + public boolean isMergeableWith(Model model) { + if ((model instanceof FlowModel)) { + return true; + } else { + return false; + } + } + public void merge(Model model) { FlowModel flow = (FlowModel) model; setParent(null); @@ -89,18 +93,6 @@ public class FlowModel extends AbstractModel { setBeanImports(merge(getBeanImports(), flow.getBeanImports())); } - /** - * Tests if the model is able to be merged with this flow - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if ((model instanceof FlowModel)) { - return true; - } else { - return false; - } - } - /** * @return the parent */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/IfModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/IfModel.java index 921e01da..f98d2289 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/IfModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/IfModel.java @@ -42,20 +42,6 @@ public class IfModel extends AbstractModel { setThen(then); } - /** - * Merge properties - * @param model the conditional to merge into this conditional - */ - public void merge(Model model) { - IfModel conditional = (IfModel) model; - setThen(merge(getThen(), conditional.getThen())); - setElse(merge(getElse(), conditional.getElse())); - } - - /** - * Tests if the model is able to be merged with this if action - * @param model the model to test - */ public boolean isMergeableWith(Model model) { if (!(model instanceof IfModel)) { return false; @@ -64,6 +50,12 @@ public class IfModel extends AbstractModel { return ObjectUtils.nullSafeEquals(getTest(), conditional.getTest()); } + public void merge(Model model) { + IfModel conditional = (IfModel) model; + setThen(merge(getThen(), conditional.getThen())); + setElse(merge(getElse(), conditional.getElse())); + } + /** * @return the test */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/InputModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/InputModel.java index 1eb47857..c9839068 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/InputModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/InputModel.java @@ -36,21 +36,6 @@ public class InputModel extends AbstractMappingModel { setValue(value); } - /** - * Merge properties - * @param model the mapping to merge into this mapping - */ - public void merge(Model model) { - InputModel input = (InputModel) model; - setValue(merge(getValue(), input.getValue())); - setType(merge(getType(), input.getType())); - setRequired(merge(getRequired(), input.getRequired())); - } - - /** - * Tests if the model is able to be merged with this input mapping - * @param model the model to test - */ public boolean isMergeableWith(Model model) { if (!(model instanceof InputModel)) { return false; @@ -59,4 +44,11 @@ public class InputModel extends AbstractMappingModel { return ObjectUtils.nullSafeEquals(getName(), input.getName()); } + public void merge(Model model) { + InputModel input = (InputModel) model; + setValue(merge(getValue(), input.getValue())); + setType(merge(getType(), input.getType())); + setRequired(merge(getRequired(), input.getRequired())); + } + } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/OutputModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/OutputModel.java index 20d8d476..ffae6241 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/OutputModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/OutputModel.java @@ -36,21 +36,6 @@ public class OutputModel extends AbstractMappingModel { setValue(value); } - /** - * Merge properties - * @param model the mapping to merge into this mapping - */ - public void merge(Model model) { - OutputModel output = (OutputModel) model; - setValue(merge(getValue(), output.getValue())); - setType(merge(getType(), output.getType())); - setRequired(merge(getRequired(), output.getRequired())); - } - - /** - * Tests if the model is able to be merged with this output mapping - * @param model the model to test - */ public boolean isMergeableWith(Model model) { if (!(model instanceof OutputModel)) { return false; @@ -59,4 +44,11 @@ public class OutputModel extends AbstractMappingModel { return ObjectUtils.nullSafeEquals(getName(), output.getName()); } + public void merge(Model model) { + OutputModel output = (OutputModel) model; + setValue(merge(getValue(), output.getValue())); + setType(merge(getType(), output.getType())); + setRequired(merge(getRequired(), output.getRequired())); + } + } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/PersistenceContextModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/PersistenceContextModel.java index 5f19ebd0..2fbab7f6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/PersistenceContextModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/PersistenceContextModel.java @@ -34,18 +34,12 @@ public class PersistenceContextModel extends AbstractModel { public PersistenceContextModel() { } - /** - * Persistence contexts are not mergeable - */ - public void merge(Model model) { - // not mergeable - } - - /** - * Persistence contexts are not mergeable - */ public boolean isMergeableWith(Model model) { return false; } + public void merge(Model model) { + + } + } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SecuredModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SecuredModel.java index b1f11694..2ee34989 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SecuredModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SecuredModel.java @@ -43,19 +43,6 @@ public class SecuredModel extends AbstractModel { setAttributes(attributes); } - /** - * Merge properties - * @param model the secured to merge into this secured - */ - public void merge(Model model) { - SecuredModel secured = (SecuredModel) model; - setMatch(merge(getMatch(), secured.getMatch())); - } - - /** - * Tests if the model is able to be merged with this secured attribute - * @param model the model to test - */ public boolean isMergeableWith(Model model) { if (!(model instanceof SecuredModel)) { return false; @@ -64,6 +51,11 @@ public class SecuredModel extends AbstractModel { return ObjectUtils.nullSafeEquals(getAttributes(), secured.getAttributes()); } + public void merge(Model model) { + SecuredModel secured = (SecuredModel) model; + setMatch(merge(getMatch(), secured.getMatch())); + } + /** * @return the attributes */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SubflowStateModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SubflowStateModel.java index 0a1f5840..2d7a807c 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SubflowStateModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/SubflowStateModel.java @@ -22,12 +22,6 @@ import org.springframework.util.StringUtils; /** * Model support for subflow states. - *

- * Starts another flow as a subflow when entered. When the subflow ends, this state is expected to respond to its result - * by executing a transition. - *

- * A subflow state is a transitionable state. A transition is triggered by the subflow outcome that was reached. - * * @author Scott Andrews */ public class SubflowStateModel extends AbstractTransitionableStateModel { @@ -46,10 +40,14 @@ public class SubflowStateModel extends AbstractTransitionableStateModel { setSubflow(subflow); } - /** - * Merge properties - * @param model the subflow state to merge into this state - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof SubflowStateModel)) { + return false; + } + SubflowStateModel state = (SubflowStateModel) model; + return ObjectUtils.nullSafeEquals(getId(), state.getId()); + } + public void merge(Model model) { SubflowStateModel state = (SubflowStateModel) model; setAttributes(merge(getAttributes(), state.getAttributes())); @@ -64,18 +62,6 @@ public class SubflowStateModel extends AbstractTransitionableStateModel { setOutputs(merge(getOutputs(), state.getOutputs())); } - /** - * Tests if the model is able to be merged with this subflow state - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof SubflowStateModel)) { - return false; - } - SubflowStateModel state = (SubflowStateModel) model; - return ObjectUtils.nullSafeEquals(getId(), state.getId()); - } - /** * @return the subflow */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/TransitionModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/TransitionModel.java index 5f92d2b8..6f5b0ca9 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/TransitionModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/TransitionModel.java @@ -44,10 +44,14 @@ public class TransitionModel extends AbstractModel { public TransitionModel() { } - /** - * Merge properties - * @param model the transition to merge into this transition - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof TransitionModel)) { + return false; + } + TransitionModel transition = (TransitionModel) model; + return ObjectUtils.nullSafeEquals(getOn(), transition.getOn()); + } + public void merge(Model model) { TransitionModel transition = (TransitionModel) model; setOnException(merge(getOnException(), transition.getOnException())); @@ -58,18 +62,6 @@ public class TransitionModel extends AbstractModel { setActions(merge(getActions(), transition.getActions(), false)); } - /** - * Tests if the model is able to be merged with this transition - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof TransitionModel)) { - return false; - } - TransitionModel transition = (TransitionModel) model; - return ObjectUtils.nullSafeEquals(getOn(), transition.getOn()); - } - /** * @return the on */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/VarModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/VarModel.java index 6a7db71d..c46a20c8 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/VarModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/VarModel.java @@ -40,22 +40,14 @@ public class VarModel extends AbstractModel { setClassName(className); } - /** - * Vars are not mergeable - * @param model the render action to merge into this render - */ - public void merge(Model model) { - // not mergeable - } - - /** - * Vars are not mergeable - * @param model the model to test - */ public boolean isMergeableWith(Model model) { return false; } + public void merge(Model model) { + + } + /** * @return the name */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ViewStateModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ViewStateModel.java index 3081cf3e..cdb84fbc 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ViewStateModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/ViewStateModel.java @@ -22,17 +22,6 @@ import org.springframework.util.StringUtils; /** * Model support for view states. - *

- * A state where the user participates. When a view state is entered, this flow pauses and control goes to the user. - * After some think time, the user resumes this flow at the view-state by signaling an event. - *

- * Once paused, a view-state may be 'refreshed' by the user. A refresh causes the response to be reissued and then - * returns control back to the user. - *

- * A view state may be configured with one or more render-actions using the 'on-render' element. Render actions are - * executed immediately before the view is rendered. - *

- * A view state is a transitionable state. A view state transition is triggered by a user event. * * @author Scott Andrews */ @@ -52,10 +41,14 @@ public class ViewStateModel extends AbstractTransitionableStateModel { setId(id); } - /** - * Merge properties - * @param model the view state to merge into this state - */ + public boolean isMergeableWith(Model model) { + if (!(model instanceof ViewStateModel)) { + return false; + } + ViewStateModel state = (ViewStateModel) model; + return ObjectUtils.nullSafeEquals(getId(), state.getId()); + } + public void merge(Model model) { ViewStateModel state = (ViewStateModel) model; setAttributes(merge(getAttributes(), state.getAttributes())); @@ -72,18 +65,6 @@ public class ViewStateModel extends AbstractTransitionableStateModel { setOnRenderActions(merge(getOnRenderActions(), state.getOnRenderActions(), false)); } - /** - * Tests if the model is able to be merged with this view state - * @param model the model to test - */ - public boolean isMergeableWith(Model model) { - if (!(model instanceof ViewStateModel)) { - return false; - } - ViewStateModel state = (ViewStateModel) model; - return ObjectUtils.nullSafeEquals(getId(), state.getId()); - } - /** * @return the view */