KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > tag > rt > fmt > ParseDateTag


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.taglibs.standard.tag.rt.fmt;
18
19 import java.util.Locale JavaDoc;
20
21 import javax.servlet.jsp.JspTagException JavaDoc;
22
23 import org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport;
24 import org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport;
25
26 /**
27  * <p>A handler for &lt;parseDate&gt; that supports rtexprvalue-based
28  * attributes.</p>
29  *
30  * @author Jan Luehe
31  */

32
33 public class ParseDateTag extends ParseDateSupport {
34
35     //*********************************************************************
36
// Accessor methods
37

38     // 'value' attribute
39
public void setValue(String JavaDoc value) throws JspTagException JavaDoc {
40         this.value = value;
41     this.valueSpecified = true;
42     }
43
44     // 'type' attribute
45
public void setType(String JavaDoc type) throws JspTagException JavaDoc {
46         this.type = type;
47     }
48
49     // 'dateStyle' attribute
50
public void setDateStyle(String JavaDoc dateStyle) throws JspTagException JavaDoc {
51         this.dateStyle = dateStyle;
52     }
53
54     // 'timeStyle' attribute
55
public void setTimeStyle(String JavaDoc timeStyle) throws JspTagException JavaDoc {
56         this.timeStyle = timeStyle;
57     }
58
59     // 'pattern' attribute
60
public void setPattern(String JavaDoc pattern) throws JspTagException JavaDoc {
61         this.pattern = pattern;
62     }
63
64     // 'timeZone' attribute
65
public void setTimeZone(Object JavaDoc timeZone) throws JspTagException JavaDoc {
66         this.timeZone = timeZone;
67     }
68
69     // 'parseLocale' attribute
70
public void setParseLocale(Object JavaDoc loc) throws JspTagException JavaDoc {
71     if (loc != null) {
72         if (loc instanceof Locale JavaDoc) {
73         this.parseLocale = (Locale JavaDoc) loc;
74         } else {
75         if (!"".equals((String JavaDoc) loc)) {
76             this.parseLocale = SetLocaleSupport.parseLocale((String JavaDoc)
77                                     loc);
78         }
79         }
80     }
81     }
82 }
83
Popular Tags