org.springframework.webflow.action
Class AttributeMapperAction

java.lang.Object
  extended by org.springframework.webflow.action.AbstractAction
      extended by org.springframework.webflow.action.AttributeMapperAction
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, Action

public class AttributeMapperAction
extends AbstractAction

Action that executes an attribute mapper to map information in the request context. Both the source and the target of the mapping will be the request context. This allows for maximum flexibility when defining attribute mapping expressions (e.g. "${flowScope.someAttribute}").

This action always returns the success event. If something goes wrong while executing the mapping, an exception is thrown.

Author:
Keith Donald, Erwin Vervaet
See Also:
AttributeMapper, RequestContext

Field Summary
 
Fields inherited from class org.springframework.webflow.action.AbstractAction
logger
 
Constructor Summary
AttributeMapperAction(org.springframework.binding.mapping.AttributeMapper attributeMapper)
          Creates a new attribute mapper action that delegates to the configured attribute mapper to complete the mapping process.
 
Method Summary
protected  Event doExecute(RequestContext context)
          Template hook method subclasses should override to encapsulate their specific action execution logic.
protected  org.springframework.binding.mapping.MappingContext getMappingContext(RequestContext context)
          Returns a context containing extra data available during attribute mapping.
 
Methods inherited from class org.springframework.webflow.action.AbstractAction
afterPropertiesSet, doPostExecute, doPreExecute, error, error, execute, getActionNameForLogging, getEventFactorySupport, initAction, no, result, result, result, result, success, success, yes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeMapperAction

public AttributeMapperAction(org.springframework.binding.mapping.AttributeMapper attributeMapper)
Creates a new attribute mapper action that delegates to the configured attribute mapper to complete the mapping process.

Parameters:
attributeMapper - the mapper
Method Detail

doExecute

protected Event doExecute(RequestContext context)
                   throws java.lang.Exception
Description copied from class: AbstractAction
Template hook method subclasses should override to encapsulate their specific action execution logic.

Specified by:
doExecute in class AbstractAction
Parameters:
context - the action execution context, for accessing and setting data in "flow scope" or "request scope"
Returns:
the action result event
Throws:
java.lang.Exception - an unrecoverable exception occured, either checked or unchecked

getMappingContext

protected org.springframework.binding.mapping.MappingContext getMappingContext(RequestContext context)
Returns a context containing extra data available during attribute mapping. The default implementation just returns null. Subclasses can override this if necessary.



Copyright © 2004-2007. All Rights Reserved.