Added BeanFactoryFlowVariable(String, BeanFactory, ScopeType) convenience constructor to the BeanFactoryFlowVariable.

Added settableExpression() method to AbstractFlowBuilder.
This commit is contained in:
Erwin Vervaet
2007-03-28 13:05:14 +00:00
parent d7447d7a85
commit b752d2dbd8
3 changed files with 27 additions and 2 deletions

View File

@@ -39,6 +39,9 @@ Package org.springframework.webflow.engine
* Added AbstractFlowBuilderFlowRegistryFactoryBean for easy setup of a flow registry containing
flows built using AbstractFlowBuilders.
* Added DefaultFlowServiceLocator(String, BeanFactory) convenience constructor to the DefaultFlowServiceLocator.
* Added BeanFactoryFlowVariable(String, BeanFactory, ScopeType) convenience constructor to the
BeanFactoryFlowVariable.
* Added settableExpression() method to AbstractFlowBuilder.
Package org.springframework.webflow.execution
* Added FlowExecutionListener.sessionCreated(RequestContext, FlowSession) callback, useful for

View File

@@ -16,6 +16,7 @@
package org.springframework.webflow.engine.builder;
import org.springframework.binding.expression.Expression;
import org.springframework.binding.expression.SettableExpression;
import org.springframework.binding.mapping.AttributeMapper;
import org.springframework.binding.mapping.Mapping;
import org.springframework.binding.mapping.MappingBuilder;
@@ -560,14 +561,22 @@ public abstract class AbstractFlowBuilder extends BaseFlowBuilder {
}
/**
* Parses the expression string into a evaluatable {@link Expression}
* object.
* Parses the expression string into an evaluatable {@link Expression} object.
* @param expressionString the expression string, e.g. flowScope.order.number
* @return the evaluatable expression
*/
protected Expression expression(String expressionString) {
return getFlowServiceLocator().getExpressionParser().parseExpression(expressionString);
}
/**
* Parses the expression string into a settable {@link Expression} object.
* @param expressionString the expression string, e.g. flowScope.order.number
* @return the evaluatable expression
*/
protected SettableExpression settableExpression(String expressionString) {
return getFlowServiceLocator().getExpressionParser().parseSettableExpression(expressionString);
}
/**
* Convert the encoded method signature string to a {@link MethodSignature}

View File

@@ -27,6 +27,7 @@ import org.springframework.webflow.execution.ScopeType;
* {@link BeanFactory}.
*
* @author Keith Donald
* @author Erwin Vervaet
*/
public class BeanFactoryFlowVariable extends FlowVariable {
@@ -40,6 +41,18 @@ public class BeanFactoryFlowVariable extends FlowVariable {
* The bean factory where initial variable values will be obtained.
*/
private BeanFactory beanFactory;
/**
* Convenience constructor to create a new bean factory flow variable.
* Defaults the bean name to the variable name.
* @param name the variable name which will also be used as the bean name
* @param beanFactory the bean factory where initial variable values will be
* obtained
* @param scope the variable scope
*/
public BeanFactoryFlowVariable(String name, BeanFactory beanFactory, ScopeType scope) {
this(name, name, beanFactory, scope);
}
/**
* Creates a new bean factory flow variable.