01: /* Generated By:JJTree: Do not edit this line. AstFloatingPoint.java */
02:
03: package org.apache.el.parser;
04:
05: import java.math.BigDecimal;
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 AstFloatingPoint extends SimpleNode {
16: public AstFloatingPoint(int id) {
17: super (id);
18: }
19:
20: private Number number;
21:
22: public Number getFloatingPoint() {
23: if (this .number == null) {
24: try {
25: this .number = new Double(this .image);
26: } catch (ArithmeticException e0) {
27: this .number = new BigDecimal(this .image);
28: }
29: }
30: return this .number;
31: }
32:
33: public Object getValue(EvaluationContext ctx) throws ELException {
34: return this .getFloatingPoint();
35: }
36:
37: public Class getType(EvaluationContext ctx) throws ELException {
38: return this.getFloatingPoint().getClass();
39: }
40: }
|