View Javadoc

1   /*
2    * $Id: SMDActionTest1.java 799110 2009-07-29 22:44:26Z musachy $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.struts2.json;
22  
23  import java.util.List;
24  import java.util.Map;
25  
26  import org.apache.struts2.json.annotations.SMDMethod;
27  
28  public class SMDActionTest1 {
29      private boolean addWasCalled;
30      @SuppressWarnings("unchecked")
31      private List listParam;
32      @SuppressWarnings("unchecked")
33      private Map mapParam;
34      private Bean beanParam;
35      private String stringParam;
36      private int intParam;
37      private boolean booleanParam;
38      private char charParam;
39      private long longParam;
40      private float floatParam;
41      private double doubleParam;
42      private short shortParam;
43      private Object objectParam;
44      private byte byteParam;
45  
46      @SMDMethod
47      public void doSomethingPrimitives(String stringParam, int intParam, boolean booleanParam, char charParam,
48              long longParam, float floatParam, double doubleParam, short shortParam, byte byteParam) {
49          this.stringParam = stringParam;
50          this.intParam = intParam;
51          this.booleanParam = booleanParam;
52          this.charParam = charParam;
53          this.longParam = longParam;
54          this.floatParam = floatParam;
55          this.doubleParam = doubleParam;
56          this.byteParam = byteParam;
57          this.shortParam = shortParam;
58      }
59  
60      @SuppressWarnings("unchecked")
61      @SMDMethod
62      public void doSomethingObjects(Bean beanParam, Map mapParam, List listParam) {
63          this.beanParam = beanParam;
64          this.mapParam = mapParam;
65          this.listParam = listParam;
66      }
67  
68      @SMDMethod
69      public void add(int a, int b) {
70          this.addWasCalled = true;
71      }
72  
73      @SMDMethod
74      public void doSomething() {
75  
76      }
77  
78      public void methodWithoutAnnotation() {
79  
80      }
81  
82      public boolean isAddWasCalled() {
83          return this.addWasCalled;
84      }
85  
86      public void setAddWasCalled(boolean addWasCalled) {
87          this.addWasCalled = addWasCalled;
88      }
89  
90      @SuppressWarnings("unchecked")
91      public List getListParam() {
92          return this.listParam;
93      }
94  
95      @SuppressWarnings("unchecked")
96      public void setListParam(List listParam) {
97          this.listParam = listParam;
98      }
99  
100     @SuppressWarnings("unchecked")
101     public Map getMapParam() {
102         return this.mapParam;
103     }
104 
105     @SuppressWarnings("unchecked")
106     public void setMapParam(Map mapParam) {
107         this.mapParam = mapParam;
108     }
109 
110     public Bean getBeanParam() {
111         return this.beanParam;
112     }
113 
114     public void setBeanParam(Bean beanParam) {
115         this.beanParam = beanParam;
116     }
117 
118     public String getStringParam() {
119         return this.stringParam;
120     }
121 
122     public void setStringParam(String stringParam) {
123         this.stringParam = stringParam;
124     }
125 
126     public int getIntParam() {
127         return this.intParam;
128     }
129 
130     public void setIntParam(int intParam) {
131         this.intParam = intParam;
132     }
133 
134     public boolean isBooleanParam() {
135         return this.booleanParam;
136     }
137 
138     public void setBooleanParam(boolean booleanParam) {
139         this.booleanParam = booleanParam;
140     }
141 
142     public char getCharParam() {
143         return this.charParam;
144     }
145 
146     public void setCharParam(char charParam) {
147         this.charParam = charParam;
148     }
149 
150     public long getLongParam() {
151         return this.longParam;
152     }
153 
154     public void setLongParam(long longParam) {
155         this.longParam = longParam;
156     }
157 
158     public float getFloatParam() {
159         return this.floatParam;
160     }
161 
162     public void setFloatParam(float floatParam) {
163         this.floatParam = floatParam;
164     }
165 
166     public double getDoubleParam() {
167         return this.doubleParam;
168     }
169 
170     public void setDoubleParam(double doubleParam) {
171         this.doubleParam = doubleParam;
172     }
173 
174     public Object getObjectParam() {
175         return this.objectParam;
176     }
177 
178     public void setObjectParam(Object objectParam) {
179         this.objectParam = objectParam;
180     }
181 
182     public byte getByteParam() {
183         return this.byteParam;
184     }
185 
186     public void setByteParam(byte byteParam) {
187         this.byteParam = byteParam;
188     }
189 
190     public short getShortParam() {
191         return this.shortParam;
192     }
193 
194     public void setShortParam(short shortParam) {
195         this.shortParam = shortParam;
196     }
197 }