|
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 |
33
| public boolean isModified()
|
|
45 |
| { |
|
46 |
33
| return _modified;
|
|
47 |
| } |
|
48 |
| |
|
49 |
3
| public void resetModified()
|
|
50 |
| { |
|
51 |
3
| _modified = false;
|
|
52 |
| } |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
15
| public ServiceEncodingImpl(String servletPath)
|
|
59 |
| { |
|
60 |
15
| this(servletPath, null, new QueryParameterMap());
|
|
61 |
| } |
|
62 |
| |
|
63 |
573
| public ServiceEncodingImpl(String servletPath, Map parametersMap)
|
|
64 |
| { |
|
65 |
573
| this(servletPath, null, new QueryParameterMap(parametersMap));
|
|
66 |
| } |
|
67 |
| |
|
68 |
957
| public ServiceEncodingImpl(String servletPath, String pathInfo, QueryParameterMap parameters)
|
|
69 |
| { |
|
70 |
957
| Defense.notNull(servletPath, "servletPath");
|
|
71 |
957
| Defense.notNull(parameters, "parameters");
|
|
72 |
| |
|
73 |
957
| _servletPath = servletPath;
|
|
74 |
957
| _pathInfo = pathInfo;
|
|
75 |
| |
|
76 |
957
| _parameters = parameters;
|
|
77 |
| } |
|
78 |
| |
|
79 |
24
| public String getParameterValue(String name)
|
|
80 |
| { |
|
81 |
24
| return _parameters.getParameterValue(name);
|
|
82 |
| } |
|
83 |
| |
|
84 |
6
| public String[] getParameterValues(String name)
|
|
85 |
| { |
|
86 |
6
| return _parameters.getParameterValues(name);
|
|
87 |
| } |
|
88 |
| |
|
89 |
12
| public void setServletPath(String servletPath)
|
|
90 |
| { |
|
91 |
12
| Defense.notNull(servletPath, "servletPath");
|
|
92 |
| |
|
93 |
12
| _servletPath = servletPath;
|
|
94 |
12
| _modified = true;
|
|
95 |
| } |
|
96 |
| |
|
97 |
30
| public void setParameterValue(String name, String value)
|
|
98 |
| { |
|
99 |
30
| _parameters.setParameterValue(name, value);
|
|
100 |
| |
|
101 |
30
| _modified = true;
|
|
102 |
| } |
|
103 |
| |
|
104 |
6
| public void setParameterValues(String name, String[] values)
|
|
105 |
| { |
|
106 |
6
| _parameters.setParameterValues(name, values);
|
|
107 |
| |
|
108 |
6
| _modified = true;
|
|
109 |
| } |
|
110 |
| |
|
111 |
576
| public String getServletPath()
|
|
112 |
| { |
|
113 |
576
| return _servletPath;
|
|
114 |
| } |
|
115 |
| |
|
116 |
3
| public String[] getParameterNames()
|
|
117 |
| { |
|
118 |
3
| return _parameters.getParameterNames();
|
|
119 |
| } |
|
120 |
| |
|
121 |
0
| public String getPathInfo()
|
|
122 |
| { |
|
123 |
0
| return _pathInfo;
|
|
124 |
| } |
|
125 |
| } |