01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Portions Copyright Apache Software Foundation.
07: *
08: * The contents of this file are subject to the terms of either the GNU
09: * General Public License Version 2 only ("GPL") or the Common Development
10: * and Distribution License("CDDL") (collectively, the "License"). You
11: * may not use this file except in compliance with the License. You can obtain
12: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
13: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
14: * language governing permissions and limitations under the License.
15: *
16: * When distributing the software, include this License Header Notice in each
17: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
18: * Sun designates this particular file as subject to the "Classpath" exception
19: * as provided by Sun in the GPL Version 2 section of the License file that
20: * accompanied this code. If applicable, add the following below the License
21: * Header, with the fields enclosed by brackets [] replaced by your own
22: * identifying information: "Portions Copyrighted [year]
23: * [name of copyright owner]"
24: *
25: * Contributor(s):
26: *
27: * If you wish your version of this file to be governed by only the CDDL or
28: * only the GPL Version 2, indicate your decision by adding "[Contributor]
29: * elects to include this software in this distribution under the [CDDL or GPL
30: * Version 2] license." If you don't indicate a single choice of license, a
31: * recipient has the option to distribute your version of this file under
32: * either the CDDL, the GPL Version 2 or to extend the choice of license to
33: * its licensees as provided above. However, if you add GPL Version 2 code
34: * and therefore, elected the GPL Version 2 license, then the option applies
35: * only if the new code is made subject to such option by the copyright
36: * holder.
37: */
38:
39: package org.apache.taglibs.standard.tag.rt.fmt;
40:
41: import java.util.Locale;
42:
43: import javax.servlet.jsp.JspTagException;
44:
45: import org.apache.taglibs.standard.tag.common.fmt.ParseNumberSupport;
46: import org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport;
47:
48: /**
49: * <p>A handler for <parseNumber> that supports rtexprvalue-based
50: * attributes.</p>
51: *
52: * @author Jan Luehe
53: */
54:
55: public class ParseNumberTag extends ParseNumberSupport {
56:
57: //*********************************************************************
58: // Accessor methods
59:
60: // 'value' attribute
61: public void setValue(String value) throws JspTagException {
62: this .value = value;
63: this .valueSpecified = true;
64: }
65:
66: // 'type' attribute
67: public void setType(String type) throws JspTagException {
68: this .type = type;
69: }
70:
71: // 'pattern' attribute
72: public void setPattern(String pattern) throws JspTagException {
73: this .pattern = pattern;
74: }
75:
76: // 'parseLocale' attribute
77: public void setParseLocale(Object loc) throws JspTagException {
78: if (loc != null) {
79: if (loc instanceof Locale) {
80: this .parseLocale = (Locale) loc;
81: } else {
82: if (!"".equals((String) loc)) {
83: this .parseLocale = SetLocaleSupport
84: .parseLocale((String) loc);
85: }
86: }
87: }
88: }
89:
90: // 'integerOnly' attribute
91: public void setIntegerOnly(boolean isIntegerOnly)
92: throws JspTagException {
93: this .isIntegerOnly = isIntegerOnly;
94: this .integerOnlySpecified = true;
95: }
96: }
|