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 FormWithDateConverter extends ActionForm {
28:
29: private static final long serialVersionUID = 1L;
30:
31: private String startDate;
32:
33: private String selectedStartDate;
34:
35: private DomainBean domainBean;
36:
37: public DomainBean getDomainBean() {
38: return domainBean;
39: }
40:
41: public void setDomainBean(DomainBean domainBean) {
42: this .domainBean = domainBean;
43: }
44:
45: @BindSimple(expression="domainBean.startDate")
46: @ConvertDate(pattern="yyyy-MM-dd")
47: public String getStartDate() {
48: return startDate;
49: }
50:
51: public void setStartDate(String startDate) {
52: this .startDate = startDate;
53: }
54:
55: @BindSelect(targetBeanExpression="targetBeanExpr",targetBeanIdProperty="",idClass=Date.class,lookupMapExpression="lookup")
56: @ConvertDate(pattern="yyyy-MM-dd")
57: public String getSelectedStartDate() {
58: return selectedStartDate;
59: }
60:
61: public void setSelectedStartDate(String selectedStartDate) {
62: this.selectedStartDate = selectedStartDate;
63: }
64:
65: }
|