Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ActionContextProxy |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2004-2010 the Seasar Foundation and the Others. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |
13 | * either express or implied. See the License for the specific language | |
14 | * governing permissions and limitations under the License. | |
15 | */ | |
16 | ||
17 | package org.seasar.cubby.action; | |
18 | ||
19 | import java.lang.reflect.Method; | |
20 | import java.util.Map; | |
21 | ||
22 | import javax.servlet.ServletRequest; | |
23 | ||
24 | /** | |
25 | * アクションコンテキストへアクセスするプロキシです。 | |
26 | * | |
27 | * @since 2.0.5 | |
28 | * @author baba | |
29 | */ | |
30 | public class ActionContextProxy implements ActionContext { | |
31 | ||
32 | /** アクションコンテキストのヘルパー */ | |
33 | private final ActionContextHelper actionContextHelper; | |
34 | ||
35 | /** | |
36 | * 指定された要求の属性に設定されたアクションコンテキストへアクセスするプロキシを生成します。 | |
37 | * | |
38 | * @param request | |
39 | * 要求 | |
40 | */ | |
41 | 0 | public ActionContextProxy(final ServletRequest request) { |
42 | 0 | this.actionContextHelper = new ActionContextHelper(request); |
43 | 0 | } |
44 | ||
45 | /** | |
46 | * {@inheritDoc} | |
47 | */ | |
48 | public Object getAction() { | |
49 | 0 | return subject().getAction(); |
50 | } | |
51 | ||
52 | /** | |
53 | * {@inheritDoc} | |
54 | */ | |
55 | public Class<?> getActionClass() { | |
56 | 0 | return subject().getActionClass(); |
57 | } | |
58 | ||
59 | /** | |
60 | * {@inheritDoc} | |
61 | */ | |
62 | public Method getActionMethod() { | |
63 | 0 | return subject().getActionMethod(); |
64 | } | |
65 | ||
66 | /** | |
67 | * {@inheritDoc} | |
68 | */ | |
69 | public Object getFormBean() { | |
70 | 0 | return subject().getFormBean(); |
71 | } | |
72 | ||
73 | /** | |
74 | * {@inheritDoc} | |
75 | */ | |
76 | public boolean isBindRequestParameterToAllProperties() { | |
77 | 0 | return subject().isBindRequestParameterToAllProperties(); |
78 | } | |
79 | ||
80 | /** | |
81 | * {@inheritDoc} | |
82 | */ | |
83 | public void invokeInitializeMethod() { | |
84 | 0 | subject().invokeInitializeMethod(); |
85 | 0 | } |
86 | ||
87 | /** | |
88 | * {@inheritDoc} | |
89 | */ | |
90 | public void invokePreRenderMethod() { | |
91 | 0 | subject().invokePreRenderMethod(); |
92 | 0 | } |
93 | ||
94 | /** | |
95 | * {@inheritDoc} | |
96 | */ | |
97 | public void invokePostRenderMethod() { | |
98 | 0 | subject().invokePostRenderMethod(); |
99 | 0 | } |
100 | ||
101 | /** | |
102 | * {@inheritDoc} | |
103 | */ | |
104 | public ActionErrors getActionErrors() { | |
105 | 0 | return subject().getActionErrors(); |
106 | } | |
107 | ||
108 | /** | |
109 | * {@inheritDoc} | |
110 | */ | |
111 | public Map<String, Object> getFlashMap() { | |
112 | 0 | return subject().getFlashMap(); |
113 | } | |
114 | ||
115 | /** | |
116 | * {@inheritDoc} | |
117 | */ | |
118 | public void clearFlash() { | |
119 | 0 | subject().clearFlash(); |
120 | 0 | } |
121 | ||
122 | /** | |
123 | * 要求の属性から被代理オブジェクトを取得します。 | |
124 | * | |
125 | * @return 被代理オブジェクト | |
126 | */ | |
127 | protected ActionContext subject() { | |
128 | 0 | return actionContextHelper.getActionContext(); |
129 | } | |
130 | ||
131 | } |