01: /*
02: * Created on 4 Sep 2007
03: */
04: package uk.org.ponder.rsf.swf.support;
05:
06: import uk.org.ponder.booleanutil.BooleanGetter;
07: import uk.org.ponder.rsf.request.EarlyRequestParser;
08: import uk.org.ponder.rsf.swf.viewparams.SWFViewParams;
09: import uk.org.ponder.rsf.viewstate.ViewParameters;
10: import uk.org.ponder.stringutil.StringGetter;
11:
12: /** For an SWF application, we do not expect a ViewProducer to exist
13: * agreeing with the view ID for an action cycle. This is queried early
14: * in order to resolve ARI2 instances, but the concrete view ID is not
15: * known at that time.
16: * @author Antranig Basman (antranig@caret.cam.ac.uk)
17: *
18: */
19:
20: public class SWFViewExpectedDeterminer implements BooleanGetter {
21:
22: private ViewParameters viewparams;
23: private StringGetter requestType;
24:
25: public void setViewParameters(ViewParameters viewparams) {
26: this .viewparams = viewparams;
27: }
28:
29: public void setRequestType(StringGetter requestType) {
30: this .requestType = requestType;
31: }
32:
33: public Boolean get() {
34: return (requestType.get().equals(
35: EarlyRequestParser.ACTION_REQUEST) && viewparams.get() instanceof SWFViewParams) ? Boolean.FALSE
36: : Boolean.TRUE;
37: }
38:
39: }
|