001: /*
002: * Copyright 2005-2006 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005: * in compliance with the License. You may obtain a copy of the License at
006: *
007: * http://www.apache.org/licenses/LICENSE-2.0
008: *
009: * Unless required by applicable law or agreed to in writing, software distributed under the License
010: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011: * or implied. See the License for the specific language governing permissions and limitations under
012: * the License.
013: */
014:
015: package org.strecks.injection.handler.impl;
016:
017: import javax.servlet.http.HttpServletRequest;
018: import javax.servlet.http.HttpServletResponse;
019:
020: import org.apache.struts.action.Action;
021: import org.apache.struts.action.ActionForm;
022: import org.apache.struts.action.ActionForward;
023: import org.apache.struts.action.ActionMapping;
024: import org.strecks.converter.StringConverter;
025: import org.strecks.injection.annotation.InjectRequestParameter;
026:
027: /**
028: * @author Phil Zoio
029: */
030: public class TestAction extends Action {
031:
032: private Long longInput;
033:
034: private Integer integerInput;
035:
036: private String convertedLongInput;
037:
038: private boolean booleanInput;
039:
040: private int intInput;
041:
042: private short shortInput;
043:
044: private byte byteInput;
045:
046: private float floatInput;
047:
048: private double doubleInput;
049:
050: private long primitiveLongInput;
051:
052: protected void setPrivateInput(Integer integerInput) {
053: this .integerInput = integerInput;
054: }
055:
056: @InjectRequestParameter()
057: public void setIntegerInput(Integer integerInput) {
058: this .integerInput = integerInput;
059: }
060:
061: @InjectRequestParameter(required=true)
062: public void setLongInput(Long longInput) {
063: this .longInput = longInput;
064: }
065:
066: @InjectRequestParameter(name="converted_long",converter=StringConverter.class)
067: public void setConvertedLongInput(String convertedLongInput) {
068: this .convertedLongInput = convertedLongInput;
069: }
070:
071: public void executeAction() {
072:
073: }
074:
075: public ActionForward execute() {
076: return null;
077: }
078:
079: public String getConvertedLongInput() {
080: return convertedLongInput;
081: }
082:
083: public Integer getIntegerInput() {
084: return integerInput;
085: }
086:
087: public Long getLongInput() {
088: return longInput;
089: }
090:
091: public boolean isBooleanInput() {
092: return booleanInput;
093: }
094:
095: @InjectRequestParameter()
096: public void setBooleanInput(boolean booleanInput) {
097: this .booleanInput = booleanInput;
098: }
099:
100: public byte getByteInput() {
101: return byteInput;
102: }
103:
104: @InjectRequestParameter()
105: public void setByteInput(byte byteInput) {
106: this .byteInput = byteInput;
107: }
108:
109: public double getDoubleInput() {
110: return doubleInput;
111: }
112:
113: @InjectRequestParameter()
114: public void setDoubleInput(double doubleInput) {
115: this .doubleInput = doubleInput;
116: }
117:
118: public float getFloatInput() {
119: return floatInput;
120: }
121:
122: @InjectRequestParameter()
123: public void setFloatInput(float floatInput) {
124: this .floatInput = floatInput;
125: }
126:
127: public int getIntInput() {
128: return intInput;
129: }
130:
131: @InjectRequestParameter()
132: public void setIntInput(int intInput) {
133: this .intInput = intInput;
134: }
135:
136: public long getPrimitiveLongInput() {
137: return primitiveLongInput;
138: }
139:
140: @InjectRequestParameter()
141: public void setPrimitiveLongInput(long primitiveLongInput) {
142: this .primitiveLongInput = primitiveLongInput;
143: }
144:
145: public short getShortInput() {
146: return shortInput;
147: }
148:
149: @InjectRequestParameter()
150: public void setShortInput(short shortInput) {
151: this .shortInput = shortInput;
152: }
153:
154: public Action clone() {
155:
156: return null;
157: }
158:
159: public void setEnvironment(ActionMapping mapping, ActionForm form,
160: HttpServletRequest request, HttpServletResponse response) {
161:
162: }
163:
164: public void preBind() {
165:
166: }
167:
168: public ActionForward cancel() {
169:
170: return null;
171: }
172:
173: public ActionForward handleRuntimeException(RuntimeException e) {
174:
175: return null;
176: }
177:
178: }
|