1 16 17 package org.apache.commons.jexl.parser; 18 19 import org.apache.commons.jexl.JexlContext; 20 21 27 public class ASTIdentifier extends SimpleNode { 28 29 protected String val; 30 31 36 public ASTIdentifier(int id) { 37 super(id); 38 } 39 40 46 public ASTIdentifier(Parser p, int id) { 47 super(p, id); 48 } 49 50 51 public Object jjtAccept(ParserVisitor visitor, Object data) { 52 return visitor.visit(this, data); 53 } 54 55 56 public Object value(JexlContext jc) throws Exception { 57 return jc.getVars().get(val); 58 } 59 60 72 public Object execute(Object obj, JexlContext jc) throws Exception { 73 return ASTArrayAccess.evaluateExpr(obj, val); 74 } 75 76 80 public String getIdentifierString() { 81 return val; 82 } 83 } 84 | Popular Tags |