1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.flow.builder; |
20 | |
|
21 | |
import javax.el.ValueExpression; |
22 | |
import javax.faces.flow.builder.ReturnBuilder; |
23 | |
import org.apache.myfaces.flow.FlowImpl; |
24 | |
import org.apache.myfaces.flow.ReturnNodeImpl; |
25 | |
import org.apache.myfaces.view.facelets.el.ELText; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class ReturnBuilderImpl extends ReturnBuilder |
33 | |
{ |
34 | |
private FlowBuilderImpl _flowBuilder; |
35 | |
private FlowImpl _facesFlow; |
36 | |
private ReturnNodeImpl _returnNode; |
37 | |
|
38 | |
public ReturnBuilderImpl(FlowBuilderImpl flowBuilder, FlowImpl facesFlow, String returnNodeId) |
39 | 0 | { |
40 | 0 | this._flowBuilder = flowBuilder; |
41 | 0 | this._facesFlow = facesFlow; |
42 | 0 | this._returnNode = new ReturnNodeImpl(returnNodeId); |
43 | 0 | this._facesFlow.putReturn(returnNodeId, _returnNode); |
44 | 0 | } |
45 | |
|
46 | |
@Override |
47 | |
public ReturnBuilder fromOutcome(String outcome) |
48 | |
{ |
49 | 0 | if (ELText.isLiteral(outcome)) |
50 | |
{ |
51 | 0 | this._returnNode.setFromOutcome(outcome); |
52 | |
} |
53 | |
else |
54 | |
{ |
55 | 0 | this._returnNode.setFromOutcome(_flowBuilder.createValueExpression(outcome)); |
56 | |
} |
57 | 0 | return this; |
58 | |
} |
59 | |
|
60 | |
@Override |
61 | |
public ReturnBuilder fromOutcome(ValueExpression outcome) |
62 | |
{ |
63 | 0 | this._returnNode.setFromOutcome(outcome); |
64 | 0 | return this; |
65 | |
} |
66 | |
|
67 | |
@Override |
68 | |
public ReturnBuilder markAsStartNode() |
69 | |
{ |
70 | 0 | _facesFlow.setStartNodeId(_returnNode.getId()); |
71 | 0 | return this; |
72 | |
} |
73 | |
|
74 | |
} |