01: package org.mvel.ast;
02:
03: import org.mvel.ASTNode;
04: import org.mvel.integration.VariableResolverFactory;
05:
06: /**
07: * @author Christopher Brock
08: */
09: public class VarPropertyNode extends ASTNode {
10: private String name;
11:
12: public VarPropertyNode(char[] expr, int fields, String name) {
13: super (expr, fields);
14: this .name = name;
15: }
16:
17: public Object getReducedValueAccelerated(Object ctx,
18: Object this Value, VariableResolverFactory factory) {
19: return factory.getVariableResolver(name).getValue();
20: }
21:
22: public Object getReducedValue(Object ctx, Object this Value,
23: VariableResolverFactory factory) {
24: return factory.getVariableResolver(name).getValue();
25: }
26: }
|