01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
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
33: AbstractFlowAttributeMapper implements Serializable {
34:
35: private final AttributeMapper inputMapper;
36:
37: private final AttributeMapper outputMapper;
38:
39: /**
40: * Create a new flow attribute mapper using given mapping strategies.
41: * @param inputMapper the input mapping strategy
42: * @param outputMapper the output mapping strategy
43: */
44: public ImmutableFlowAttributeMapper(AttributeMapper inputMapper,
45: AttributeMapper outputMapper) {
46: this .inputMapper = inputMapper;
47: this .outputMapper = outputMapper;
48: }
49:
50: protected AttributeMapper getInputMapper() {
51: return inputMapper;
52: }
53:
54: protected AttributeMapper getOutputMapper() {
55: return outputMapper;
56: }
57:
58: public String toString() {
59: return new ToStringCreator(this ).append("inputMapper",
60: inputMapper).append("outputMapper", outputMapper)
61: .toString();
62: }
63: }
|