private Object[] getParameters(EvaluationContext ctx) throws ELException { if (this.children == null) return null; Object[] obj = new Object[this.children.length]; for (int i = 0; i < obj.length; i++) { obj[i] = this.children[i].getValue(ctx); } return obj; }
public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
public Class getType(EvaluationContext ctx) throws ELException { return this.children[0].getType(ctx); }
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
private final Target getTarget(EvaluationContext ctx) throws ELException { // evaluate expr-a to value-a Object base = this.children[0].getValue(ctx); // if our base is null (we know there are more properites to evaluate) if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } // set up our start/end int propCount = this.jjtGetNumChildren() - 1; int i = 1; while (base != null && i < propCount) { base = ((ValueSuffixNode) this.children[i]).getTarget(base, ctx); i++; if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } } Target t = new Target(); t.base = base; t.node = (ValueSuffixNode) this.children[propCount]; return t; }
public boolean isReadOnly(EvaluationContext ctx) throws ELException { return this.children[0].isReadOnly(ctx); }
int numChildren = n.jjtGetNumChildren(); if (numChildren == 1) { n = n.jjtGetChild(0); } else { Class type = null; Node child = null; for (int i = 0; i < numChildren; i++) { child = n.jjtGetChild(i); if (child instanceof AstLiteralExpression) continue; n = n.jjtGetChild(0);
/** * Evaluates the expression relative to the provided context, and returns * information about the actual referenced method. * * @param context * The context of this evaluation * @return an instance of <code>MethodInfo</code> containing information * about the method the expression evaluated to. * @throws NullPointerException * if context is <code>null</code> or the base object is * <code>null</code> on the last resolution. * @throws PropertyNotFoundException * if one of the property resolutions failed because a specified * variable or property does not exist or is not readable. * @throws MethodNotFoundException * if no suitable method can be found. * @throws ELException * if an exception was thrown while performing property or * variable resolution. The thrown exception must be included as * the cause property of this exception, if available. * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext) */ public MethodInfo getMethodInfo(ELContext context) throws PropertyNotFoundException, MethodNotFoundException, ELException { Node n = this.getNode(); EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return n.getMethodInfo(ctx, this.paramTypes); }
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().invoke(ctx, this.paramTypes, params);
private Node build() throws ELException { Node n = createNodeInternal(this.expression); this.prepare(n); if (n instanceof AstDeferredExpression || n instanceof AstDynamicExpression) { n = n.jjtGetChild(0); } return n; }
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
private final Target getTarget(EvaluationContext ctx) throws ELException { // evaluate expr-a to value-a Object base = this.children[0].getValue(ctx); // if our base is null (we know there are more properites to evaluate) if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } // set up our start/end int propCount = this.jjtGetNumChildren() - 1; int i = 1; while (base != null && i < propCount) { base = ((ValueSuffixNode) this.children[i]).getTarget(base, ctx); i++; if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } } Target t = new Target(); t.base = base; t.node = (ValueSuffixNode) this.children[propCount]; return t; }
public boolean isReadOnly(EvaluationContext ctx) throws ELException { return this.children[0].isReadOnly(ctx); }
int numChildren = n.jjtGetNumChildren(); if (numChildren == 1) { n = n.jjtGetChild(0); } else { Class type = null; Node child = null; for (int i = 0; i < numChildren; i++) { child = n.jjtGetChild(i); if (child instanceof AstLiteralExpression) continue; n = n.jjtGetChild(0);
/** * Evaluates the expression relative to the provided context, and returns * information about the actual referenced method. * * @param context * The context of this evaluation * @return an instance of <code>MethodInfo</code> containing information * about the method the expression evaluated to. * @throws NullPointerException * if context is <code>null</code> or the base object is * <code>null</code> on the last resolution. * @throws PropertyNotFoundException * if one of the property resolutions failed because a specified * variable or property does not exist or is not readable. * @throws MethodNotFoundException * if no suitable method can be found. * @throws ELException * if an exception was thrown while performing property or * variable resolution. The thrown exception must be included as * the cause property of this exception, if available. * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext) */ public MethodInfo getMethodInfo(ELContext context) throws PropertyNotFoundException, MethodNotFoundException, ELException { Node n = this.getNode(); EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return n.getMethodInfo(ctx, this.paramTypes); }
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().invoke(ctx, this.paramTypes, params);
private Node build() throws ELException { Node n = createNodeInternal(this.expression); this.prepare(n); if (n instanceof AstDeferredExpression || n instanceof AstDynamicExpression) { n = n.jjtGetChild(0); } return n; }
public Object getValue(EvaluationContext ctx) throws ELException { return this.children[0].getValue(ctx); }
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
private final Target getTarget(EvaluationContext ctx) throws ELException { // evaluate expr-a to value-a Object base = this.children[0].getValue(ctx); // if our base is null (we know there are more properites to evaluate) if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } // set up our start/end int propCount = this.jjtGetNumChildren() - 1; int i = 1; while (base != null && i < propCount) { base = ((ValueSuffixNode) this.children[i]).getTarget(base, ctx); i++; if (base == null) { throw new PropertyNotFoundException(MessageFactory.get( "error.unreachable.base", this.children[0].getImage())); } } Target t = new Target(); t.base = base; t.node = (ValueSuffixNode) this.children[propCount]; return t; }