1 23 24 package com.sun.el.parser; 25 26 import java.math.BigDecimal ; 27 28 import javax.el.ELException; 29 30 import com.sun.el.lang.EvaluationContext; 31 32 36 public final class AstFloatingPoint extends SimpleNode { 37 public AstFloatingPoint(int id) { 38 super(id); 39 } 40 41 private Number number; 42 43 public Number getFloatingPoint() { 44 if (this.number == null) { 45 try { 46 this.number = new Double (this.image); 47 } catch (ArithmeticException e0) { 48 this.number = new BigDecimal (this.image); 49 } 50 } 51 return this.number; 52 } 53 54 public Object getValue(EvaluationContext ctx) 55 throws ELException { 56 return this.getFloatingPoint(); 57 } 58 59 public Class getType(EvaluationContext ctx) 60 throws ELException { 61 return this.getFloatingPoint().getClass(); 62 } 63 } 64 | Popular Tags |