KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > tag > el > sql > DateParamTag


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 package org.apache.taglibs.standard.tag.el.sql;
17
18 import java.util.Date JavaDoc;
19
20 import javax.servlet.jsp.JspException JavaDoc;
21
22 import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;
23 import org.apache.taglibs.standard.tag.common.sql.DateParamTagSupport;
24
25 /**
26  * Subclass for the JSTL library with EL support.
27  *
28  * @author Justyna Horwat
29  */

30 public class DateParamTag extends DateParamTagSupport {
31     
32     private String JavaDoc valueEL;
33     private String JavaDoc typeEL;
34
35     public void setValue(String JavaDoc valueEL) {
36     this.valueEL = valueEL;
37     }
38
39     public void setType(String JavaDoc typeEL) {
40     this.typeEL = typeEL;
41     }
42
43     public int doStartTag() throws JspException JavaDoc {
44         evaluateExpressions();
45     return super.doStartTag();
46     }
47
48     //*********************************************************************
49
// Private utility methods
50

51     // Evaluates expressions as necessary
52
private void evaluateExpressions() throws JspException JavaDoc {
53     if (valueEL != null) {
54         value = (Date JavaDoc) ExpressionEvaluatorManager.evaluate(
55                 "value", valueEL, Date JavaDoc.class, this, pageContext);
56     }
57
58     if (typeEL != null) {
59         type = (String JavaDoc) ExpressionEvaluatorManager.evaluate(
60                 "type", typeEL, String JavaDoc.class, this, pageContext);
61         }
62     }
63
64 }
65
Popular Tags