Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.springframework.webflow.support
Class ParameterizableFlowAttributeMapper  view ParameterizableFlowAttributeMapper download ParameterizableFlowAttributeMapper.java

java.lang.Object
  extended byorg.springframework.webflow.support.ParameterizableFlowAttributeMapper
All Implemented Interfaces:
org.springframework.webflow.FlowAttributeMapper, java.io.Serializable

public class ParameterizableFlowAttributeMapper
extends java.lang.Object
implements org.springframework.webflow.FlowAttributeMapper, java.io.Serializable

Generic flow attribute mapper implementation that allows mappings to be configured in a declarative fashion.

Exposed configuration properties:
name default description
inputAttribute(s) null Sets the name of input attributes in flow scope to map to the subflow.
inputMapper null The AttributeMapper strategy responsible for mapping starting subflow input attributes from a suspending parent flow.
inputMapping(s) empty Mappings executed when mapping input data from the parent flow to a newly spawned sub flow. Each list item must be a String, a Map or a List. If the list item is a simple String value, the attribute will be mapped as having the same name in the parent flow and in the sub flow. If the list item is a Map, each map entry must be a String key naming the attribute in the parent flow, and a String value naming the attribute in the child flow. If the list item is itself a List, then that list is evaluated recursively, and must contain Strings, Lists or Maps.
inputMappingsMap empty Mappings executed when mapping input data from the parent flow to a newly spawned sub flow. The keys in given map are the names of entries in the parent model that will be mapped. The value associated with a key is the name of the target entry that will be placed in the subflow model.
outputAttribute(s) null ets the name of output attributes in flow scope to map to the parent flow.
outputMapper null The AttributeMapper strategy responsible for mapping ending subflow output attributes to a resuming parent flow as output.
outputMapping(s) empty Mappings executed when mapping subflow output data back to the parent flow (once the subflow ends and the parent flow resumes). Each list item must be a String, a List or a Map. If the list item is a simple String value, the attribute will be mapped as having the same name in the parent flow and in the child flow. If the list item is a Map, each map entry must be a String key naming the attribute in the sub flow, and a String value naming the attribute in the parent flow. If the list item is itself a List, then that list is evaluated recursively, and must contain Strings, Lists or Maps.
outputMappingsMap empty Mappings executed when mapping subflow output data back to the parent flow (once the subflow ends and the parent flow resumes). The keys in given map are the names of entries in the subflow model that will be mapped. The value associated with a key is the name of the target entry that will be placed in the parent flow model.

The mappings defined using the above configuration properties fully support bean property access. So an entry name in a mapping can either be "beanName" or "beanName.propName". Nested property values are also supported ("beanName.propName.propName"). When the from mapping string is enclosed in "${...}", it will be interpreted as an expression that will be evaluated against the request execution context.


Nested Class Summary
static class ParameterizableFlowAttributeMapper.FlowScopeAwareParameterizableAttributeMapper
          Attribute mapper specialization that knows if an "attribute name" is provided, and not a value ${expression}, that the name should be treated as a flow scope expression.
 
Field Summary
private  AttributeMapper inputMapper
           
protected  org.apache.commons.logging.Log logger
          Logger, usable in subclasses.
private  AttributeMapper outputMapper
           
 
Constructor Summary
ParameterizableFlowAttributeMapper()
           
 
Method Summary
 java.util.Map createSubflowInput(org.springframework.webflow.RequestContext context)
          Create a map of attributes that should be passed as input to a spawning child flow.
protected  java.util.Map getMappingContext(org.springframework.webflow.RequestContext context)
          Returns a map of contextual data available during mapping.
 void mapSubflowOutput(org.springframework.webflow.RequestContext context)
          Map relavent attributes of an ending subflow session back up to a resuming parent flow session.
 void setInputAttribute(java.lang.String attributeName)
          Sets the name of an input attribute in flow scope to map to the subflow.
 void setInputAttributes(java.lang.String[] attributeNames)
          Sets the name of input attributes in flow scope to map to the subflow.
 void setInputMapper(AttributeMapper mapper)
          Set the AttributesMapper strategy responsible for mapping starting subflow input attributes from a suspending parent flow.
 void setInputMapping(Mapping mapping)
          Set the input mapping to use when mapping properties in the request context to the sub flow scope.
 void setInputMappings(java.util.Collection inputMappings)
          Set the mappings that will be executed when mapping properties in a parent flow to a sub flow scope.
 void setInputMappingsMap(java.util.Map inputMappings)
          Set the mappings that will be executed when mapping model data to the sub flow.
 void setOutputAttribute(java.lang.String attributeName)
          Sets the name of an output attribute in flow scope to map up to the parent flow.
 void setOutputAttributes(java.lang.String[] attributeNames)
          Sets the name of output attributes in flow scope to map to the parent flow.
 void setOutputMapper(AttributeMapper mapper)
          Set the AttributesMapper strategy responsible for mapping ending subflow output attributes to a resuming parent flow as output.
 void setOutputMapping(Mapping mapping)
          Set the output mapping to use when mapping properties in sub flow back to a resuming parent flow.
 void setOutputMappings(java.util.Collection outputMappings)
          Set the mappings that will be executed when mapping model data from the sub flow.
 void setOutputMappingsMap(java.util.Map outputMappings)
          Set the mappings that will be executed when mapping model data from the sub flow.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger, usable in subclasses.


inputMapper

private AttributeMapper inputMapper

outputMapper

private AttributeMapper outputMapper
Constructor Detail

ParameterizableFlowAttributeMapper

public ParameterizableFlowAttributeMapper()
Method Detail

setInputAttribute

public void setInputAttribute(java.lang.String attributeName)
Sets the name of an input attribute in flow scope to map to the subflow.


setInputAttributes

public void setInputAttributes(java.lang.String[] attributeNames)
Sets the name of input attributes in flow scope to map to the subflow.


setInputMapping

public void setInputMapping(Mapping mapping)
Set the input mapping to use when mapping properties in the request context to the sub flow scope. This is a convenience method for setting a single mapping.


setInputMappingsMap

public void setInputMappingsMap(java.util.Map inputMappings)
Set the mappings that will be executed when mapping model data to the sub flow. This method is provided as a configuration convenience.


setInputMappings

public void setInputMappings(java.util.Collection inputMappings)
Set the mappings that will be executed when mapping properties in a parent flow to a sub flow scope. Each list item must be a String, a Mapping, a List, or a Map. If the list item is a simple String value, the attribute will be mapped as having the same name in the parent flow and in the sub flow. If the list item is a Map, each map entry must be a String key naming the attribute in the parent flow, and a String value naming the attribute in the child flow. If the list item is itself a List, then that list is evaluated recursively, and must itself contain Strings, Lists or Maps.


setInputMapper

public void setInputMapper(AttributeMapper mapper)
Set the AttributesMapper strategy responsible for mapping starting subflow input attributes from a suspending parent flow.


setOutputAttribute

public void setOutputAttribute(java.lang.String attributeName)
Sets the name of an output attribute in flow scope to map up to the parent flow.


setOutputAttributes

public void setOutputAttributes(java.lang.String[] attributeNames)
Sets the name of output attributes in flow scope to map to the parent flow.


setOutputMapping

public void setOutputMapping(Mapping mapping)
Set the output mapping to use when mapping properties in sub flow back to a resuming parent flow. This is a convenience method for setting a single mapping.


setOutputMappingsMap

public void setOutputMappingsMap(java.util.Map outputMappings)
Set the mappings that will be executed when mapping model data from the sub flow. This method is provided as a configuration convenience.


setOutputMappings

public void setOutputMappings(java.util.Collection outputMappings)
Set the mappings that will be executed when mapping model data from the sub flow. Each list item must be a String, Mapping, a List, or a Map. If the list item is a simple String value, the attribute will be mapped as having the same name in the parent flow and in the child flow. If the list item is a Map, each map entry must be a String key naming the attribute in the sub flow, and a String value naming the attribute in the parent flow. If the list item is itself a List, then that list is evaluated recursively, and must itself contain Strings, Mappings, Lists, or Maps.


setOutputMapper

public void setOutputMapper(AttributeMapper mapper)
Set the AttributesMapper strategy responsible for mapping ending subflow output attributes to a resuming parent flow as output.


createSubflowInput

public java.util.Map createSubflowInput(org.springframework.webflow.RequestContext context)
Description copied from interface: org.springframework.webflow.FlowAttributeMapper
Create a map of attributes that should be passed as input to a spawning child flow.

Attributes set in the Map returned by this method will be added to flow scope of the child subflow session when the session is spawned and activated.

Specified by:
createSubflowInput in interface org.springframework.webflow.FlowAttributeMapper

mapSubflowOutput

public void mapSubflowOutput(org.springframework.webflow.RequestContext context)
Description copied from interface: org.springframework.webflow.FlowAttributeMapper
Map relavent attributes of an ending subflow session back up to a resuming parent flow session. This maps the output of the child as new input to the resuming parent.

Specified by:
mapSubflowOutput in interface org.springframework.webflow.FlowAttributeMapper

getMappingContext

protected java.util.Map getMappingContext(org.springframework.webflow.RequestContext context)
Returns a map of contextual data available during mapping.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).