01: /*
02: * Created on 07-May-2006
03: */
04: package uk.org.ponder.rsf.flow.support;
05:
06: import java.util.List;
07:
08: import uk.org.ponder.rsf.flow.ARIResult;
09: import uk.org.ponder.rsf.flow.ActionResultInterpreter;
10: import uk.org.ponder.rsf.viewstate.ViewParameters;
11:
12: /** An ARIResolver that will accept a list of primary resolvers which it
13: * will poll in order. The first resolver that does not return <code>>null</code>
14: * will have its result accepted.
15: * @author Antranig Basman (amb26@ponder.org.uk)
16: *
17: */
18:
19: public class ARIManager implements ActionResultInterpreter {
20:
21: private List arilist;
22:
23: public void setARIList(List arilist) {
24: this .arilist = arilist;
25: }
26:
27: public ARIResult interpretActionResult(ViewParameters incoming,
28: Object result) {
29: for (int i = 0; i < arilist.size(); ++i) {
30: ActionResultInterpreter ari = (ActionResultInterpreter) arilist
31: .get(i);
32: ARIResult togo = ari
33: .interpretActionResult(incoming, result);
34: if (togo != null)
35: return togo;
36: }
37: return null;
38: }
39:
40: }
|