View Javadoc

1   /*
2    * $Id: TestAction.java 539825 2007-05-20 04:28:35Z mrdon $
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;
22  
23  import java.util.Arrays;
24  import java.util.Collection;
25  import java.util.List;
26  import java.util.Map;
27  
28  import org.apache.struts2.views.jsp.ui.User;
29  
30  import com.opensymphony.xwork2.Action;
31  import com.opensymphony.xwork2.ActionSupport;
32  
33  
34  /***
35   */
36  public class TestAction extends ActionSupport {
37  
38      private static final long serialVersionUID = -8891365561914451494L;
39  
40      private Collection collection;
41      private Collection collection2;
42      private Map map;
43      private String foo;
44  
45      private String result;
46      private User user;
47      private String[] array;
48      private String[][] list;
49      private List list2;
50      private List list3;
51      private SomeEnum status = SomeEnum.COMPLETED;
52  
53      public Collection getCollection() {
54          return collection;
55      }
56  
57      public void setCollection(Collection collection) {
58          this.collection = collection;
59      }
60  
61      public Map getMap() {
62          return map;
63      }
64  
65      public void setMap(Map map) {
66          this.map = map;
67      }private Integer fooInt;
68  
69      public String getFoo() {
70          return foo;
71      }
72  
73      public void setFoo(String foo) {
74          this.foo = foo;
75      }
76  
77      public String getResult() {
78          return result;
79      }
80  
81      public void setResult(String result) {
82          this.result = result;
83      }
84  
85      public User getUser() {
86          return user;
87      }
88  
89      public void setUser(User user) {
90          this.user = user;
91      }
92  
93      public String[] getArray() {
94          return array;
95      }
96  
97      public void setArray(String[] array) {
98          this.array = array;
99      }
100 
101     public String[][] getList() {
102         return list;
103     }
104 
105     public void setList(String[][] list) {
106         this.list = list;
107     }
108 
109     public List getList2() {
110         return list2;
111     }
112 
113     public void setList2(List list2) {
114         this.list2 = list2;
115     }
116 
117     public void setList3(List list) {
118         this.list3 = list;
119     }
120 
121     public List getList3() {
122         return this.list3;
123     }
124 
125     public Collection getCollection2() {
126         return this.collection2;
127     }
128 
129     public void setCollection2(Collection collection) {
130         this.collection2 = collection;
131     }
132 
133     public Integer getFooInt() {
134         return fooInt;
135     }
136 
137     public void setFooInt(Integer fooInt) {
138         this.fooInt = fooInt;
139     }
140     
141     public String execute() throws Exception {
142         if (result == null) {
143             result = Action.SUCCESS;
144         }
145 
146         return result;
147     }
148 
149     public String doInput() throws Exception {
150         return INPUT;
151     }
152 
153 	public SomeEnum getStatus() {
154 		return status;
155 	}
156 
157 	public void setStatus(SomeEnum status) {
158 		this.status = status;
159 	}
160     
161     public List<SomeEnum> getStatusList() {
162     	return Arrays.asList(SomeEnum.values());
163     }
164 
165 }