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