01: /* Generated By:JJTree: Do not edit this line. AstInteger.java */
02:
03: package org.apache.el.parser;
04:
05: import java.math.BigInteger;
06:
07: import javax.el.ELException;
08:
09: import org.apache.el.lang.EvaluationContext;
10:
11: /**
12: * @author Jacob Hookom [jacob@hookom.net]
13: * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
14: */
15: public final class AstInteger extends SimpleNode {
16: public AstInteger(int id) {
17: super (id);
18: }
19:
20: private Number number;
21:
22: protected Number getInteger() {
23: if (this .number == null) {
24: try {
25: this .number = new Long(this .image);
26: } catch (ArithmeticException e1) {
27: this .number = new BigInteger(this .image);
28: }
29: }
30: return number;
31: }
32:
33: public Class getType(EvaluationContext ctx) throws ELException {
34: return this .getInteger().getClass();
35: }
36:
37: public Object getValue(EvaluationContext ctx) throws ELException {
38: return this.getInteger();
39: }
40: }
|