1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
package org.apache.tiles.request; |
23 | |
|
24 | |
import java.io.IOException; |
25 | |
import java.io.OutputStream; |
26 | |
import java.io.PrintWriter; |
27 | |
import java.io.Writer; |
28 | |
import java.util.Collections; |
29 | |
import java.util.List; |
30 | |
import java.util.Locale; |
31 | |
import java.util.Map; |
32 | |
|
33 | |
import org.apache.tiles.request.attribute.Addable; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public class DefaultRequestWrapper implements RequestWrapper { |
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
private Request context; |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | 15 | public DefaultRequestWrapper(Request context) { |
54 | 15 | this.context = context; |
55 | 15 | } |
56 | |
|
57 | |
|
58 | |
public Request getWrappedRequest() { |
59 | 1 | return context; |
60 | |
} |
61 | |
|
62 | |
|
63 | |
public Map<String, String> getHeader() { |
64 | 1 | return context.getHeader(); |
65 | |
} |
66 | |
|
67 | |
|
68 | |
public Map<String, String[]> getHeaderValues() { |
69 | 1 | return context.getHeaderValues(); |
70 | |
} |
71 | |
|
72 | |
|
73 | |
public Addable<String> getResponseHeaders() { |
74 | 1 | return context.getResponseHeaders(); |
75 | |
} |
76 | |
|
77 | |
|
78 | |
public ApplicationContext getApplicationContext() { |
79 | 1 | return context.getApplicationContext(); |
80 | |
} |
81 | |
|
82 | |
|
83 | |
public OutputStream getOutputStream() throws IOException { |
84 | 1 | return context.getOutputStream(); |
85 | |
} |
86 | |
|
87 | |
|
88 | |
public Writer getWriter() throws IOException { |
89 | 1 | return context.getWriter(); |
90 | |
} |
91 | |
|
92 | |
|
93 | |
public PrintWriter getPrintWriter() throws IOException { |
94 | 1 | return context.getPrintWriter(); |
95 | |
} |
96 | |
|
97 | |
|
98 | |
public boolean isResponseCommitted() { |
99 | 1 | return context.isResponseCommitted(); |
100 | |
} |
101 | |
|
102 | |
|
103 | |
public Map<String, String> getParam() { |
104 | 1 | return context.getParam(); |
105 | |
} |
106 | |
|
107 | |
|
108 | |
public Map<String, String[]> getParamValues() { |
109 | 1 | return context.getParamValues(); |
110 | |
} |
111 | |
|
112 | |
|
113 | |
public Locale getRequestLocale() { |
114 | 1 | return context.getRequestLocale(); |
115 | |
} |
116 | |
|
117 | |
|
118 | |
public boolean isUserInRole(String role) { |
119 | 1 | return context.isUserInRole(role); |
120 | |
} |
121 | |
|
122 | |
|
123 | |
public Map<String, Object> getContext(String scope) { |
124 | 1 | return context.getContext(scope); |
125 | |
} |
126 | |
|
127 | |
|
128 | |
public List<String> getAvailableScopes() { |
129 | 1 | return context.getAvailableScopes(); |
130 | |
} |
131 | |
} |