diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java index 1e5c1a31..f13e47a4 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 the original author or authors. + * Copyright 2004-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,15 @@ import org.springframework.util.ClassUtils; import org.springframework.webflow.expression.el.WebFlowELExpressionParser; /** - * Static factory that returns the default {@link ExpressionParser} for use by Spring Web Flow. Marked final with a - * private constructor to prevent subclassing. + * Static factory that returns the default {@link ExpressionParser} used by Spring Web Flow. Marked final with a private + * constructor to prevent subclassing. *

* This factory employs the following algorithm when the returned ExpressionParser instance is used for the first time: *

* * @author Keith Donald diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/WebFlowOgnlExpressionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/WebFlowOgnlExpressionParser.java index 3316c9e7..3816c805 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/WebFlowOgnlExpressionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/WebFlowOgnlExpressionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 the original author or authors. + * Copyright 2004-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.webflow.execution.Action; import org.springframework.webflow.execution.RequestContext; /** - * An extension of {@link OgnlExpressionParser} that registers web flow specific property accessors. + * An extension of {@link OgnlExpressionParser} that registers Web Flow-specific PropertyAccessors. * * @author Keith Donald */ @@ -46,7 +46,7 @@ public class WebFlowOgnlExpressionParser extends OgnlExpressionParser { private static final Log logger = LogFactory.getLog(WebFlowOgnlExpressionParser.class); /** - * Creates a webflow-specific ognl expression parser. + * Creates a Web Flow OGNL Expression Parser. */ public WebFlowOgnlExpressionParser() { addPropertyAccessor(MapAdaptable.class, new MapAdaptablePropertyAccessor()); @@ -55,6 +55,9 @@ public class WebFlowOgnlExpressionParser extends OgnlExpressionParser { addPropertyAccessor(Action.class, new ActionPropertyAccessor()); } + /** + * Resolves Map Adaptable properties. + */ private static class MapAdaptablePropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { return ((MapAdaptable) target).asMap().get(name); @@ -66,12 +69,18 @@ public class WebFlowOgnlExpressionParser extends OgnlExpressionParser { } } + /** + * Resolves Mutable Attribute Map properties, also capable of setting properties. + */ private static class MutableAttributeMapPropertyAccessor extends MapAdaptablePropertyAccessor { public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException { ((MutableAttributeMap) target).put((String) name, value); } } + /** + * Resolves RequestContext properties. Supports several implicit variables and scope searching routines. + */ private static class RequestContextPropertyAccessor implements PropertyAccessor { private static boolean securityPresent = ClassUtils @@ -179,6 +188,9 @@ public class WebFlowOgnlExpressionParser extends OgnlExpressionParser { } } + /** + * Resolves multi action methods. + */ private static class ActionPropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { Action action = (Action) target; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ActionMethodELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ActionMethodELResolver.java index a7e15077..edcf0bee 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ActionMethodELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ActionMethodELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.Iterator; @@ -16,6 +31,8 @@ import org.springframework.webflow.execution.Action; * {@link org.springframework.webflow.action.MultiAction}. Returns an AnnotatedAction wrapper around the target Action * configured with the appropriate method dispatching rules. * + * @see org.springframework.webflow.action.EvaluateAction + * * @author Keith Donald */ public class ActionMethodELResolver extends ELResolver { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java index f3693bd4..bc5684a7 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.HashSet; @@ -14,6 +29,23 @@ import org.apache.commons.logging.LogFactory; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.RequestContextHolder; +/** + * Resolves "implicit" or well-known flow variables; for example "flowScope" in an expression like #{flowScope.foo}. The + * list of implicit flow variables consists of: + * + *
+ * requestParameters
+ * requestScope
+ * flashScope
+ * flowScope
+ * conversationScope
+ * messageContext
+ * flowExecutionContext
+ * flowExecutionUrl
+ * 
+ * + * @author Keith Donald + */ public class ImplicitFlowVariableELResolver extends ELResolver { private static final Log logger = LogFactory.getLog(ImplicitFlowVariableELResolver.class); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java index a3279a94..5da61e67 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.Iterator; @@ -12,8 +27,10 @@ import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.RequestContextHolder; /** - * Custom EL resolver that resolves to a thread-bound RequestContext object for binding expressions prefixed with a - * {@link #REQUEST_CONTEXT_VARIABLE_NAME}. For instance "#{flowRequestContext.conversationScope.myProperty}". + * Custom EL resolver that resolves the current RequestContext under the variable {@link #REQUEST_CONTEXT_VARIABLE_NAME}. + * Allows for accessing any propert of the RequestContext instance. For example: + * "#{flowRequestContext.conversationScope.myProperty}". + * * @author Jeremy Grelle */ public class RequestContextELResolver extends ELResolver { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java index 065b39fb..a696e102 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.Iterator; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java index 7fedd4ed..7406dd0a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import javax.el.ELContext; @@ -9,7 +24,7 @@ import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.RequestContextHolder; /** - * EL resolver for Spring Beans accessible to the flow's local bean factory. + * EL resolver for resolving Spring Beans accessible by a flow's bean factory. * @author Jeremy Grelle */ public class SpringBeanWebFlowELResolver extends SpringBeanELResolver { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java index 2b1c1f45..9909a3db 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.Iterator; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java index 0428ea97..0c695a8a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.webflow.expression.el; import java.util.ArrayList; @@ -17,8 +32,7 @@ import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.execution.RequestContext; /** - * An ExpressionParser that allows Spring and Web Flow managed beans to be referenced in expressions in the - * FlowDefinition. + * Allows for Unified EL expressions in a FlowDefinition. * * @author Jeremy Grelle * @author Scott Andrews @@ -28,12 +42,20 @@ public class WebFlowELExpressionParser extends ELExpressionParser { private static boolean securityPresent = ClassUtils .isPresent("org.springframework.security.context.SecurityContextHolder"); + /** + * Creates a new Web Flow EL expression parser. + * @param expressionFactory the underlying EL expression factory (EL provider specific) + */ public WebFlowELExpressionParser(ExpressionFactory expressionFactory) { super(expressionFactory); putContextFactory(RequestContext.class, new RequestContextELContextFactory()); putContextFactory(MutableAttributeMap.class, new AttributeMapELContextFactory()); } + /** + * Configures EL context instances for evaluating against a Web Flow request context. + * @author Keith Donald + */ private static class RequestContextELContextFactory implements ELContextFactory { public ELContext getELContext(Object target) { RequestContext context = (RequestContext) target; @@ -51,6 +73,10 @@ public class WebFlowELExpressionParser extends ELExpressionParser { } } + /** + * Configures EL context instances for evaluating against an AttributeMap. + * @author Keith Donald + */ private static class AttributeMapELContextFactory implements ELContextFactory { public ELContext getELContext(Object target) { ELResolver resolver = new DefaultELResolver(target, null);