KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > el > parser > AstInteger


1 /* Generated By:JJTree: Do not edit this line. AstInteger.java */
2
3 package org.apache.el.parser;
4
5 import java.math.BigInteger JavaDoc;
6
7 import javax.el.ELException;
8
9 import org.apache.el.lang.EvaluationContext;
10
11
12 /**
13  * @author Jacob Hookom [jacob@hookom.net]
14  * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
15  */

16 public final class AstInteger extends SimpleNode {
17     public AstInteger(int id) {
18         super(id);
19     }
20
21     private Number JavaDoc number;
22
23     protected Number JavaDoc getInteger() {
24         if (this.number == null) {
25             try {
26                 this.number = new Long JavaDoc(this.image);
27             } catch (ArithmeticException JavaDoc e1) {
28                 this.number = new BigInteger JavaDoc(this.image);
29             }
30         }
31         return number;
32     }
33
34     public Class JavaDoc getType(EvaluationContext ctx)
35             throws ELException {
36         return this.getInteger().getClass();
37     }
38
39     public Object JavaDoc getValue(EvaluationContext ctx)
40             throws ELException {
41         return this.getInteger();
42     }
43 }
44
Popular Tags