001: /*
002: * $Id: TestAction.java 539825 2007-05-20 04:28:35Z mrdon $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2;
022:
023: import java.util.Arrays;
024: import java.util.Collection;
025: import java.util.List;
026: import java.util.Map;
027:
028: import org.apache.struts2.views.jsp.ui.User;
029:
030: import com.opensymphony.xwork2.Action;
031: import com.opensymphony.xwork2.ActionSupport;
032:
033: /**
034: */
035: public class TestAction extends ActionSupport {
036:
037: private static final long serialVersionUID = -8891365561914451494L;
038:
039: private Collection collection;
040: private Collection collection2;
041: private Map map;
042: private String foo;
043:
044: private String result;
045: private User user;
046: private String[] array;
047: private String[][] list;
048: private List list2;
049: private List list3;
050: private SomeEnum status = SomeEnum.COMPLETED;
051:
052: public Collection getCollection() {
053: return collection;
054: }
055:
056: public void setCollection(Collection collection) {
057: this .collection = collection;
058: }
059:
060: public Map getMap() {
061: return map;
062: }
063:
064: public void setMap(Map map) {
065: this .map = map;
066: }
067:
068: private Integer fooInt;
069:
070: public String getFoo() {
071: return foo;
072: }
073:
074: public void setFoo(String foo) {
075: this .foo = foo;
076: }
077:
078: public String getResult() {
079: return result;
080: }
081:
082: public void setResult(String result) {
083: this .result = result;
084: }
085:
086: public User getUser() {
087: return user;
088: }
089:
090: public void setUser(User user) {
091: this .user = user;
092: }
093:
094: public String[] getArray() {
095: return array;
096: }
097:
098: public void setArray(String[] array) {
099: this .array = array;
100: }
101:
102: public String[][] getList() {
103: return list;
104: }
105:
106: public void setList(String[][] list) {
107: this .list = list;
108: }
109:
110: public List getList2() {
111: return list2;
112: }
113:
114: public void setList2(List list2) {
115: this .list2 = list2;
116: }
117:
118: public void setList3(List list) {
119: this .list3 = list;
120: }
121:
122: public List getList3() {
123: return this .list3;
124: }
125:
126: public Collection getCollection2() {
127: return this .collection2;
128: }
129:
130: public void setCollection2(Collection collection) {
131: this .collection2 = collection;
132: }
133:
134: public Integer getFooInt() {
135: return fooInt;
136: }
137:
138: public void setFooInt(Integer fooInt) {
139: this .fooInt = fooInt;
140: }
141:
142: public String execute() throws Exception {
143: if (result == null) {
144: result = Action.SUCCESS;
145: }
146:
147: return result;
148: }
149:
150: public String doInput() throws Exception {
151: return INPUT;
152: }
153:
154: public SomeEnum getStatus() {
155: return status;
156: }
157:
158: public void setStatus(SomeEnum status) {
159: this .status = status;
160: }
161:
162: public List<SomeEnum> getStatusList() {
163: return Arrays.asList(SomeEnum.values());
164: }
165:
166: }
|