org.apache.commons.jexl.parser

Class ASTIdentifier

public class ASTIdentifier extends SimpleNode

Simple identifier - $foo or $foo.bar (both parts are identifiers).

Version: $Id: ASTIdentifier.java 398199 2006-04-29 16:30:05Z dion $

Field Summary
protected Stringval
the name of the variable.
Constructor Summary
ASTIdentifier(int id)
Create the node given an id.
ASTIdentifier(Parser p, int id)
Create a node with the given parser and id.
Method Summary
Objectexecute(Object obj, JexlContext jc)
returns the value of itself applied to the object.
StringgetIdentifierString()
Gets the name of the variable.
ObjectjjtAccept(ParserVisitor visitor, Object data)
Objectvalue(JexlContext jc)

Field Detail

val

protected String val
the name of the variable.

Constructor Detail

ASTIdentifier

public ASTIdentifier(int id)
Create the node given an id.

Parameters: id node id.

ASTIdentifier

public ASTIdentifier(Parser p, int id)
Create a node with the given parser and id.

Parameters: p a parser. id node id.

Method Detail

execute

public Object execute(Object obj, JexlContext jc)
returns the value of itself applied to the object. We assume that an identifier can be gotten via a get(String). e.g. if we have bean.property, 'property' has been parsed as an identifier, and we need to resolve the expression by calling the property getter.

Parameters: obj the object to evaluate against. jc the JexlContext.

Returns: the resulting value.

Throws: Exception on any error.

See Also: ASTArrayAccess

getIdentifierString

public String getIdentifierString()
Gets the name of the variable.

Returns: the variable name.

jjtAccept

public Object jjtAccept(ParserVisitor visitor, Object data)
{@inheritDoc }

value

public Object value(JexlContext jc)
{@inheritDoc }
Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.