1 2 3 package org.apache.el.parser; 4 5 import java.math.BigInteger ; 6 7 import javax.el.ELException; 8 9 import org.apache.el.lang.EvaluationContext; 10 11 12 16 public final class AstInteger extends SimpleNode { 17 public AstInteger(int id) { 18 super(id); 19 } 20 21 private Number number; 22 23 protected Number getInteger() { 24 if (this.number == null) { 25 try { 26 this.number = new Long (this.image); 27 } catch (ArithmeticException e1) { 28 this.number = new BigInteger (this.image); 29 } 30 } 31 return number; 32 } 33 34 public Class getType(EvaluationContext ctx) 35 throws ELException { 36 return this.getInteger().getClass(); 37 } 38 39 public Object getValue(EvaluationContext ctx) 40 throws ELException { 41 return this.getInteger(); 42 } 43 } 44 | Popular Tags |