01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.converter.internal.impl;
16:
17: import java.util.Date;
18:
19: import org.apache.struts.action.ActionForm;
20: import org.strecks.bind.annotation.BindSelect;
21: import org.strecks.bind.annotation.BindSimple;
22: import org.strecks.converter.annotation.ConvertDate;
23:
24: /**
25: * @author Phil Zoio
26: */
27: public class BeanWithExplicitConverters extends ActionForm {
28:
29: private static final long serialVersionUID = 1L;
30:
31: private String startDate;
32:
33: private String startDateWithout;
34:
35: private String selectedStartDate;
36:
37: private String selectedStartDateWithout;
38:
39: @BindSimple(expression="domainBean.startDate")
40: @ConvertDate(pattern="yyyy-MM-dd")
41: public String getStartDate() {
42: return startDate;
43: }
44:
45: @BindSelect(targetBeanExpression="targetBeanExpr",targetBeanIdProperty="",idClass=Date.class,lookupMapExpression="lookup")
46: @ConvertDate(pattern="yyyy-MM-dd")
47: public String getSelectedStartDate() {
48: return selectedStartDate;
49: }
50:
51: @BindSelect(targetBeanExpression="targetBeanExpr",targetBeanIdProperty="",idClass=Date.class,lookupMapExpression="lookup")
52: public String getSelectedStartDateWithout() {
53: return selectedStartDateWithout;
54: }
55:
56: @BindSimple(expression="domainBean.startDate")
57: public String getStartDateWithout() {
58: return startDateWithout;
59: }
60:
61: public void setSelectedStartDate(String selectedStartDate) {
62: this .selectedStartDate = selectedStartDate;
63: }
64:
65: public void setSelectedStartDateWithout(
66: String selectedStartDateWithout) {
67: this .selectedStartDateWithout = selectedStartDateWithout;
68: }
69:
70: public void setStartDate(String startDate) {
71: this .startDate = startDate;
72: }
73:
74: public void setStartDateWithout(String startDateWithout) {
75: this.startDateWithout = startDateWithout;
76: }
77:
78: }
|