| java.lang.Object org.apache.commons.jexl.parser.SimpleNode org.apache.commons.jexl.parser.ASTArrayAccess
ASTArrayAccess | public class ASTArrayAccess extends SimpleNode (Code) | | Like an ASTIdentifier, but with array access allowed.
$foo[2]
author: Geir Magnusson Jr. version: $Id: ASTArrayAccess.java 398180 2006-04-29 15:40:35Z dion $ |
ASTArrayAccess | public ASTArrayAccess(int id)(Code) | | Create the node given an id.
Parameters: id - node id. |
ASTArrayAccess | public ASTArrayAccess(Parser p, int id)(Code) | | Create a node with the given parser and id.
Parameters: p - a parser. Parameters: id - node id. |
evaluateExpr | public static Object evaluateExpr(Object o, Object loc) throws Exception(Code) | | Evaluate the Array expression 'loc' on the given object, o.
e.g. in 'a[2]', 2 is 'loc' and a is 'o'.
If o or loc are null, null is returned.
If o is a Map, o.get(loc) is returned.
If o is a List, o.get(loc) is returned. loc must resolve to an int value.
If o is an Array, o[loc] is returned. loc must resolve to an int value.
Otherwise loc is treated as a bean property of o.
Parameters: o - an object to be accessed using the array operator or '.' operator. Parameters: loc - the index of the object to be returned. the resulting value. throws: Exception - on any error. |
execute | public Object execute(Object obj, JexlContext jc) throws Exception(Code) | | evaluate array access upon a base object.
foo.bar[2]
makes me rethink the array operator :)
Parameters: jc - the JexlContext to evaluate against. Parameters: obj - not used. the value of the array expression. throws: Exception - on any error |
getIdentifierString | public String getIdentifierString()(Code) | | Gets the variable name piece of the expression.
a String of the identifer. See Also: ASTIdentifier#getIdentifierString(). |
|
|