01: /*
02: * Created on 07-May-2006
03: */
04: package uk.org.ponder.rsf.viewstate.support;
05:
06: import java.util.HashMap;
07: import java.util.Map;
08:
09: import uk.org.ponder.rsf.viewstate.ViewParamsMapInfo;
10:
11: /** (Cached) mapping information describing the mapping from URL attributes
12: * onto bean paths for ViewParameters objects.
13: * @author Antranig Basman (amb26@ponder.org.uk)
14: */
15:
16: public class ConcreteViewParamsMapInfo implements ViewParamsMapInfo {
17: /** Names of attributes to be parsed (e.g. from a URL) */
18: public String[] attrnames;
19: /** corresponding EL paths using the ViewParameters object as a base */
20: public String[] paths;
21: /** The EL paths (if any) to be parsed onto the URL pathinfo trunk */
22: public String[] trunkpaths;
23: /** A lookup from the <code>paths</code> entry to <code>attrname</code> **/
24: Map pathToAttr = new HashMap();
25: /** A lookup from the <code>attrname</code> entry to <code>path</code> **/
26: Map attrToPath = new HashMap();
27:
28: public String pathToAttribute(String path) {
29: return (String) pathToAttr.get(path);
30: }
31:
32: public String attributeToPath(String attribute) {
33: return (String) attrToPath.get(attribute);
34: }
35: }
|