1 package org.apache.velocity.runtime.parser.node; 2 3 18 19 import org.apache.velocity.context.InternalContextAdapter; 20 import org.apache.velocity.runtime.parser.Parser; 21 22 public class ASTNumberLiteral extends SimpleNode 23 { 24 private Integer value = null; 25 26 public ASTNumberLiteral(int id) 27 { 28 super(id); 29 } 30 31 public ASTNumberLiteral(Parser p, int id) 32 { 33 super(p, id); 34 } 35 36 37 public Object jjtAccept(ParserVisitor visitor, Object data) 38 { 39 return visitor.visit(this, data); 40 } 41 42 46 public Object init( InternalContextAdapter context, Object data) 47 throws Exception 48 { 49 52 53 super.init( context, data ); 54 55 value = new Integer ( getFirstToken().image ); 56 57 return data; 58 } 59 60 public Object value( InternalContextAdapter context) 61 { 62 return value; 63 } 64 65 } 66 | Popular Tags |