01: /*
02: * Created on 16 Jul 2007
03: */
04: package uk.org.ponder.rsf.viewstate;
05:
06: import java.util.Map;
07:
08: import uk.org.ponder.rsf.viewstate.support.ViewParamsMapper;
09:
10: /** Converts ViewParameters objects to and from a "broken-down" raw
11: * representation. The "default" implementation is the {@link ViewParamsMapper}.
12: * @author Antranig Basman (antranig@caret.cam.ac.uk)
13: *
14: */
15:
16: public interface ViewParamsCodec {
17: /** Returns <code>true</code> if this type (or instance) of ViewParameters is supported
18: * by this codec.
19: */
20: public boolean isSupported(ViewParameters viewparams);
21:
22: /** A rendering of the supplied ViewParameters into a Raw form, or <code>null</code>
23: * if the parameters are not supported.
24: */
25: public RawURLState renderViewParams(ViewParameters toparse);
26:
27: /** Parse the supplied ViewParameters out of its Raw form. The codec may
28: * also support the functionality of reporting any "left-over" parameters
29: * that were in the raw state but now used in the conversion.
30: */
31: public boolean parseViewParams(ViewParameters target,
32: RawURLState rawstate, Map unusedParams);
33:
34: /** Returns a ViewParamsMapInfo for the supplied params */
35: public ViewParamsMapInfo getMappingInfo(ViewParameters viewparams);
36: }
|