KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > engine > builder > xml > ImmutableFlowAttributeMapper


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.webflow.engine.builder.xml;
17
18 import java.io.Serializable JavaDoc;
19
20 import org.springframework.binding.mapping.AttributeMapper;
21 import org.springframework.core.style.ToStringCreator;
22 import org.springframework.webflow.engine.support.AbstractFlowAttributeMapper;
23
24 /**
25  * Simple flow attribute mapper that holds an input and output mapper strategy.
26  * This is an internal helper class of the XmlFlowBuilder.
27  *
28  * @see org.springframework.webflow.engine.builder.xml.XmlFlowBuilder
29  *
30  * @author Keith Donald
31  */

32 final class ImmutableFlowAttributeMapper extends AbstractFlowAttributeMapper implements Serializable JavaDoc {
33
34     private final AttributeMapper inputMapper;
35
36     private final AttributeMapper outputMapper;
37
38     /**
39      * Create a new flow attribute mapper using given mapping strategies.
40      * @param inputMapper the input mapping strategy
41      * @param outputMapper the output mapping strategy
42      */

43     public ImmutableFlowAttributeMapper(AttributeMapper inputMapper, AttributeMapper outputMapper) {
44         this.inputMapper = inputMapper;
45         this.outputMapper = outputMapper;
46     }
47
48     protected AttributeMapper getInputMapper() {
49         return inputMapper;
50     }
51
52     protected AttributeMapper getOutputMapper() {
53         return outputMapper;
54     }
55
56     public String JavaDoc toString() {
57         return new ToStringCreator(this).append("inputMapper", inputMapper)
58             .append("outputMapper", outputMapper).toString();
59     }
60 }
Popular Tags