org.springframework.webflow.engine.support
Class AbstractFlowAttributeMapper

java.lang.Object
  extended by org.springframework.webflow.engine.support.AbstractFlowAttributeMapper
All Implemented Interfaces:
java.io.Serializable, FlowAttributeMapper
Direct Known Subclasses:
ConfigurableFlowAttributeMapper

public abstract class AbstractFlowAttributeMapper
extends java.lang.Object
implements FlowAttributeMapper, java.io.Serializable

Convenient base class for attribute mapper implementations. Encapsulates common attribute mapper workflow. Contains no state. Subclasses must override the getInputMapper() and getOutputMapper() methods to return the input mapper and output mapper, respectively.

Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
AbstractFlowAttributeMapper()
           
 
Method Summary
 MutableAttributeMap createFlowInput(RequestContext context)
          Create a map of attributes that should be passed as input to a spawning flow.
protected abstract  org.springframework.binding.mapping.AttributeMapper getInputMapper()
          Returns the input mapper to use to map attributes of a parent flow RequestContext to a subflow input attribute map.
protected  org.springframework.binding.mapping.MappingContext getMappingContext(RequestContext context)
          Returns a map of contextual data available during mapping.
protected abstract  org.springframework.binding.mapping.AttributeMapper getOutputMapper()
          Returns the output mapper to use to map attributes from a subflow output attribute map to the RequestContext.
 void mapFlowOutput(AttributeMap subflowOutput, RequestContext context)
          Map output attributes of an ended flow to a resuming parent flow session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFlowAttributeMapper

public AbstractFlowAttributeMapper()
Method Detail

getInputMapper

protected abstract org.springframework.binding.mapping.AttributeMapper getInputMapper()
Returns the input mapper to use to map attributes of a parent flow RequestContext to a subflow input attribute map.

Returns:
the input mapper, or null if none
See Also:
createFlowInput(RequestContext)

getOutputMapper

protected abstract org.springframework.binding.mapping.AttributeMapper getOutputMapper()
Returns the output mapper to use to map attributes from a subflow output attribute map to the RequestContext.

Returns:
the output mapper, or null if none
See Also:
mapFlowOutput(AttributeMap, RequestContext)

createFlowInput

public MutableAttributeMap createFlowInput(RequestContext context)
Description copied from interface: FlowAttributeMapper
Create a map of attributes that should be passed as input to a spawning flow.

Attributes set in the map returned by this method are availale as input to the subflow when its session is spawned.

Specified by:
createFlowInput in interface FlowAttributeMapper
Parameters:
context - the current request execution context, which gives access to the parent flow scope, the request scope, any event parameters, etcetera
Returns:
a map of attributes (name=value pairs) to pass as input to the spawning subflow

mapFlowOutput

public void mapFlowOutput(AttributeMap subflowOutput,
                          RequestContext context)
Description copied from interface: FlowAttributeMapper
Map output attributes of an ended flow to a resuming parent flow session. This maps the output of the child as new input to the resuming parent, typically adding data to flow scope.

Specified by:
mapFlowOutput in interface FlowAttributeMapper
Parameters:
subflowOutput - the output attributes exposed by the ended subflow
context - the current request execution context, which gives access to the parent flow scope

getMappingContext

protected org.springframework.binding.mapping.MappingContext getMappingContext(RequestContext context)
Returns a map of contextual data available during mapping. This implementation just returns null.



Copyright © 2004-2007. All Rights Reserved.