WebFlowBean.java
01 /**
02  *
03  * All content copyright (c) 2003-2008 Terracotta, Inc.,
04  * except as may otherwise be noted in a separate copyright notice.
05  * All rights reserved.
06  *
07  */
08 package demo.webflow;
09 
10 import java.io.Serializable;
11 
12 /**
13  *  Encapsulates logic for the demo webflow
14  *
15  *@author    Terracotta, Inc.
16  */
17 public class WebFlowBean
18        implements Serializable {
19 
20    private String state = STATEA;
21    private String valueA;
22    private String valueB;
23    private String valueC;
24    private String valueD;
25 
26    /**
27     *  Description of the Field
28     */
29    public static final String STATEA = "stateA";
30    /**
31     *  Description of the Field
32     */
33    public static final String STATEB = "stateB";
34    /**
35     *  Description of the Field
36     */
37    public static final String STATEC = "stateC";
38    /**
39     *  Description of the Field
40     */
41    public static final String STATED = "stateD";
42    /**
43     *  Description of the Field
44     */
45    public static final String COMPLETE = "complete";
46    private static final long serialVersionUID = 1L;
47 
48    public String setState(String state) {
49       this.state = state;
50       return state;
51    }
52 
53    public String setA(String value) {
54       this.valueA = value;
55       setState(value == null ? STATEA : STATEB);
56       return getState();
57    }
58 
59    public String setB(String value) {
60       this.valueB = value;
61       setState(value == null ? STATEB : STATEC);
62       return getState();
63    }
64 
65    public String setC(String value) {
66       this.valueC = value;
67       setState(value == null ? STATEC : STATED);
68       return getState();
69    }
70 
71    public String setD(String value) {
72       this.valueD = value;
73       setState((valueA != null&& (valueB != null&& (valueC != null&& (valueD != null? COMPLETE : STATED);
74       return getState();
75    }
76 
77    public String getState() {
78       return state;
79    }
80 
81    public String getA() {
82       return valueA;
83    }
84 
85    public String getB() {
86       return valueB;
87    }
88 
89    public String getC() {
90       return valueC;
91    }
92 
93    public String getD() {
94       return valueD;
95    }
96 }