Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
DirectEventServiceParameter |
|
| 1.0;1 |
1 | // Copyright 2004, 2005 The Apache Software Foundation |
|
2 | // |
|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 | // you may not use this file except in compliance with the License. |
|
5 | // You may obtain a copy of the License at |
|
6 | // |
|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
|
8 | // |
|
9 | // Unless required by applicable law or agreed to in writing, software |
|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 | // See the License for the specific language governing permissions and |
|
13 | // limitations under the License. |
|
14 | ||
15 | package org.apache.tapestry.engine; |
|
16 | ||
17 | import org.apache.hivemind.util.Defense; |
|
18 | import org.apache.tapestry.IDirectEvent; |
|
19 | ||
20 | /** |
|
21 | * Parameter object used by {@link org.apache.tapestry.engine.DirectEventService}. |
|
22 | * |
|
23 | * @author jkuhnert |
|
24 | * @since 4.1 |
|
25 | */ |
|
26 | public class DirectEventServiceParameter |
|
27 | { |
|
28 | protected IDirectEvent _direct; |
|
29 | ||
30 | protected Object[] _serviceParameters; |
|
31 | ||
32 | protected String[] _updateParts; |
|
33 | ||
34 | protected boolean _json; |
|
35 | ||
36 | public DirectEventServiceParameter(IDirectEvent direct) |
|
37 | { |
|
38 | 0 | this(direct, null, null, false); |
39 | 0 | } |
40 | ||
41 | public DirectEventServiceParameter(IDirectEvent direct, Object[] serviceParameters) |
|
42 | { |
|
43 | 4 | this(direct, serviceParameters, null, false); |
44 | 4 | } |
45 | ||
46 | /** |
|
47 | * Creates a new direct service parameter map. |
|
48 | * |
|
49 | * @param direct The object implementing the direct triggerable interface |
|
50 | * @param serviceParameters The parameters for the triggered object |
|
51 | * @param updateParts The parts expected to be updated on any returned response |
|
52 | * triggerd by this direct call. |
|
53 | */ |
|
54 | public DirectEventServiceParameter(IDirectEvent direct, Object[] serviceParameters, |
|
55 | String[] updateParts, boolean json) |
|
56 | 7 | { |
57 | 7 | Defense.notNull(direct, "direct"); |
58 | ||
59 | 7 | _direct = direct; |
60 | 7 | _serviceParameters = serviceParameters; |
61 | 7 | _updateParts = updateParts; |
62 | 7 | _json = json; |
63 | 7 | } |
64 | ||
65 | public IDirectEvent getDirect() |
|
66 | { |
|
67 | 4 | return _direct; |
68 | } |
|
69 | ||
70 | public Object[] getServiceParameters() |
|
71 | { |
|
72 | 4 | return _serviceParameters; |
73 | } |
|
74 | ||
75 | public String[] getUpdateParts() |
|
76 | { |
|
77 | 4 | return _updateParts; |
78 | } |
|
79 | ||
80 | public boolean isJSON() |
|
81 | { |
|
82 | 4 | return _json; |
83 | } |
|
84 | } |