1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.engine; |
16 |
| |
17 |
| import java.util.Map; |
18 |
| |
19 |
| import org.apache.hivemind.util.Defense; |
20 |
| import org.apache.tapestry.util.QueryParameterMap; |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| public class ServiceEncodingImpl implements ServiceEncoding |
30 |
| { |
31 |
| private String _servletPath; |
32 |
| |
33 |
| private String _pathInfo; |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| private final QueryParameterMap _parameters; |
41 |
| |
42 |
| private boolean _modified; |
43 |
| |
44 |
22
| public boolean isModified()
|
45 |
| { |
46 |
22
| return _modified;
|
47 |
| } |
48 |
| |
49 |
2
| public void resetModified()
|
50 |
| { |
51 |
2
| _modified = false;
|
52 |
| } |
53 |
| |
54 |
| |
55 |
| |
56 |
| |
57 |
| |
58 |
10
| public ServiceEncodingImpl(String servletPath)
|
59 |
| { |
60 |
10
| this(servletPath, null, new QueryParameterMap());
|
61 |
| } |
62 |
| |
63 |
382
| public ServiceEncodingImpl(String servletPath, Map parametersMap)
|
64 |
| { |
65 |
382
| this(servletPath, null, new QueryParameterMap(parametersMap));
|
66 |
| } |
67 |
| |
68 |
638
| public ServiceEncodingImpl(String servletPath, String pathInfo, QueryParameterMap parameters)
|
69 |
| { |
70 |
638
| Defense.notNull(servletPath, "servletPath");
|
71 |
638
| Defense.notNull(parameters, "parameters");
|
72 |
| |
73 |
638
| _servletPath = servletPath;
|
74 |
638
| _pathInfo = pathInfo;
|
75 |
| |
76 |
638
| _parameters = parameters;
|
77 |
| } |
78 |
| |
79 |
16
| public String getParameterValue(String name)
|
80 |
| { |
81 |
16
| return _parameters.getParameterValue(name);
|
82 |
| } |
83 |
| |
84 |
4
| public String[] getParameterValues(String name)
|
85 |
| { |
86 |
4
| return _parameters.getParameterValues(name);
|
87 |
| } |
88 |
| |
89 |
8
| public void setServletPath(String servletPath)
|
90 |
| { |
91 |
8
| Defense.notNull(servletPath, "servletPath");
|
92 |
| |
93 |
8
| _servletPath = servletPath;
|
94 |
8
| _modified = true;
|
95 |
| } |
96 |
| |
97 |
20
| public void setParameterValue(String name, String value)
|
98 |
| { |
99 |
20
| _parameters.setParameterValue(name, value);
|
100 |
| |
101 |
20
| _modified = true;
|
102 |
| } |
103 |
| |
104 |
4
| public void setParameterValues(String name, String[] values)
|
105 |
| { |
106 |
4
| _parameters.setParameterValues(name, values);
|
107 |
| |
108 |
4
| _modified = true;
|
109 |
| } |
110 |
| |
111 |
384
| public String getServletPath()
|
112 |
| { |
113 |
384
| return _servletPath;
|
114 |
| } |
115 |
| |
116 |
2
| public String[] getParameterNames()
|
117 |
| { |
118 |
2
| return _parameters.getParameterNames();
|
119 |
| } |
120 |
| |
121 |
0
| public String getPathInfo()
|
122 |
| { |
123 |
0
| return _pathInfo;
|
124 |
| } |
125 |
| } |