KickJava   Java API By Example, From Geeks To Geeks.

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


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.ParseNumberSupport;
24 import org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport;
25
26 /**
27  * <p>A handler for &lt;parseNumber&gt; that supports rtexprvalue-based
28  * attributes.</p>
29  *
30  * @author Jan Luehe
31  */

32
33 public class ParseNumberTag extends ParseNumberSupport {
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     // 'pattern' attribute
50
public void setPattern(String JavaDoc pattern) throws JspTagException JavaDoc {
51         this.pattern = pattern;
52     }
53
54     // 'parseLocale' attribute
55
public void setParseLocale(Object JavaDoc loc) throws JspTagException JavaDoc {
56     if (loc != null) {
57         if (loc instanceof Locale JavaDoc) {
58         this.parseLocale = (Locale JavaDoc) loc;
59         } else {
60         if (!"".equals((String JavaDoc) loc)) {
61             this.parseLocale = SetLocaleSupport.parseLocale((String JavaDoc)
62                                     loc);
63         }
64         }
65     }
66     }
67
68     // 'integerOnly' attribute
69
public void setIntegerOnly(boolean isIntegerOnly) throws JspTagException JavaDoc {
70         this.isIntegerOnly = isIntegerOnly;
71     this.integerOnlySpecified = true;
72     }
73 }
74
Popular Tags