001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Portions Copyright Apache Software Foundation.
007: *
008: * The contents of this file are subject to the terms of either the GNU
009: * General Public License Version 2 only ("GPL") or the Common Development
010: * and Distribution License("CDDL") (collectively, the "License"). You
011: * may not use this file except in compliance with the License. You can obtain
012: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
013: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
014: * language governing permissions and limitations under the License.
015: *
016: * When distributing the software, include this License Header Notice in each
017: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
018: * Sun designates this particular file as subject to the "Classpath" exception
019: * as provided by Sun in the GPL Version 2 section of the License file that
020: * accompanied this code. If applicable, add the following below the License
021: * Header, with the fields enclosed by brackets [] replaced by your own
022: * identifying information: "Portions Copyrighted [year]
023: * [name of copyright owner]"
024: *
025: * Contributor(s):
026: *
027: * If you wish your version of this file to be governed by only the CDDL or
028: * only the GPL Version 2, indicate your decision by adding "[Contributor]
029: * elects to include this software in this distribution under the [CDDL or GPL
030: * Version 2] license." If you don't indicate a single choice of license, a
031: * recipient has the option to distribute your version of this file under
032: * either the CDDL, the GPL Version 2 or to extend the choice of license to
033: * its licensees as provided above. However, if you add GPL Version 2 code
034: * and therefore, elected the GPL Version 2 license, then the option applies
035: * only if the new code is made subject to such option by the copyright
036: * holder.
037: */
038:
039: package org.apache.taglibs.standard.tag.rt.fmt;
040:
041: import java.util.Locale;
042:
043: import javax.servlet.jsp.JspTagException;
044:
045: import org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport;
046: import org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport;
047:
048: /**
049: * <p>A handler for <parseDate> that supports rtexprvalue-based
050: * attributes.</p>
051: *
052: * @author Jan Luehe
053: */
054:
055: public class ParseDateTag extends ParseDateSupport {
056:
057: //*********************************************************************
058: // Accessor methods
059:
060: // 'value' attribute
061: public void setValue(String value) throws JspTagException {
062: this .value = value;
063: this .valueSpecified = true;
064: }
065:
066: // 'type' attribute
067: public void setType(String type) throws JspTagException {
068: this .type = type;
069: }
070:
071: // 'dateStyle' attribute
072: public void setDateStyle(String dateStyle) throws JspTagException {
073: this .dateStyle = dateStyle;
074: }
075:
076: // 'timeStyle' attribute
077: public void setTimeStyle(String timeStyle) throws JspTagException {
078: this .timeStyle = timeStyle;
079: }
080:
081: // 'pattern' attribute
082: public void setPattern(String pattern) throws JspTagException {
083: this .pattern = pattern;
084: }
085:
086: // 'timeZone' attribute
087: public void setTimeZone(Object timeZone) throws JspTagException {
088: this .timeZone = timeZone;
089: }
090:
091: // 'parseLocale' attribute
092: public void setParseLocale(Object loc) throws JspTagException {
093: if (loc != null) {
094: if (loc instanceof Locale) {
095: this .parseLocale = (Locale) loc;
096: } else {
097: if (!"".equals((String) loc)) {
098: this .parseLocale = SetLocaleSupport
099: .parseLocale((String) loc);
100: }
101: }
102: }
103: }
104: }
|