Object[] paramValues) throws ELException { Target t = getTarget(ctx); Method m = null; Object[] values = null; Class<?>[] types = null; if (isParametersProvided()) { values = ((AstMethodParameters) this.jjtGetChild( this.jjtGetNumChildren() - 1)).getParameters(ctx); types = getTypesFromValues(values); } else { values = paramValues; values = convertArgs(ctx, values, m);
public void setValue(EvaluationContext ctx, Object value) throws ELException { Target t = getTarget(ctx); ctx.setPropertyResolved(false); ELResolver resolver = ctx.getELResolver(); // coerce to the expected type Class<?> targetClass = resolver.getType(ctx, t.base, t.property); if (COERCE_TO_ZERO || !isAssignable(value, targetClass)) { value = ELSupport.coerceToType(value, targetClass); } resolver.setValue(ctx, t.base, t.property, value); }
/** * @since EL 2.2 */ @Override public ValueReference getValueReference(EvaluationContext ctx) { // Check this is a reference to a base and a property if (this.children.length > 2 && this.jjtGetChild(2) instanceof AstMethodParameters) { // This is a method call return null; } Target t = getTarget(ctx); return new ValueReference(t.base, t.property); }
Object[] paramValues) throws ELException { Target t = getTarget(ctx); Method m = null; Object[] values = null; if (isParametersProvided()) { values = ((AstMethodParameters) this.jjtGetChild(2)).getParameters(ctx); Class<?>[] types = getTypesFromValues(values); m = ReflectionUtil.getMethod(t.base, t.property, types); } else { values = toVarArgs(values, m);
public ValueReference getValueReference(EvaluationContext ctx) { try { Target t = getTarget(ctx); return new ValueReference(t.base, t.property); } catch (Exception e) { return null; } } private final Target getTarget(EvaluationContext ctx) throws ELException {
public boolean isParametersProvided() { if (jjtGetNumChildren() > 1 && this.children[1] != null && this.children[1] instanceof AstDotSuffix) { return (this.children[1].jjtGetNumChildren()) > 0; } return false; }
int propCount = this.jjtGetNumChildren(); this.jjtGetChild(propCount - 1) instanceof AstMethodParameters) {
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object base = this.children[0].getValue(ctx); int propCount = this.jjtGetNumChildren(); int i = 1; Object suffix = null; getTypesFromValues(paramValues), paramValues); i+=2; } else {
public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException { Target t = getTarget(ctx); Object[] params = null; if (jjtGetNumChildren() > 1 && this.children[1] instanceof AstDotSuffix) { params = ((AstDotSuffix) this.children[1]).getParameters(ctx); } Object result = null; if (params != null && params.length > 0) { ELResolver resolver = ctx.getELResolver(); ctx.setPropertyResolved(false); result = resolver.invoke(ctx, t.base, t.property, null, params); } else { Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes); try { result = m.invoke(t.base, (Object[]) paramValues); } catch (IllegalAccessException iae) { throw new ELException(iae); } catch (InvocationTargetException ite) { throw new ELException(ite.getCause()); } } return result; }
final public void Value() throws ParseException { AstValue jjtn001 = new AstValue(JJTVALUE); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @since EL 2.2 */ @Override public boolean isParametersProvided() { if (this.children.length > 2 && this.jjtGetChild(2) instanceof AstMethodParameters) { return true; } return false; } }
@Override // Interface el.parser.Node uses raw types (and is auto-generated) public MethodInfo getMethodInfo(EvaluationContext ctx, @SuppressWarnings("rawtypes") Class[] paramTypes) throws ELException { Target t = getTarget(ctx); Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes); return new MethodInfo(m.getName(), m.getReturnType(), m .getParameterTypes()); }
/** * @since EL 2.2 */ @Override public ValueReference getValueReference(EvaluationContext ctx) { // Check this is a reference to a base and a property if (this.children.length > 2 && this.jjtGetChild(2) instanceof AstMethodParameters) { // This is a method call return null; } Target t = getTarget(ctx); return new ValueReference(t.base, t.property); }
public Object getValue(EvaluationContext ctx) throws ELException { Object base = this.children[0].getValue(ctx); int propCount = this.jjtGetNumChildren(); int i = 1; Object property = null; ELResolver resolver = ctx.getELResolver(); while (base != null && i < propCount) { property = this.children[i].getValue(ctx); if (property == null) { return null; } else { Object[] params = null; if (this.children[i] instanceof AstDotSuffix) { params = ((AstDotSuffix) this.children[i]).getParameters(ctx); } if (params != null && params.length > 0) { ctx.setPropertyResolved(false); base = resolver.invoke(ctx, base, property, null, params); } else { ctx.setPropertyResolved(false); base = resolver.getValue(ctx, base, property); } } i++; } return base; }
int propCount = this.jjtGetNumChildren(); this.jjtGetChild(propCount - 1) instanceof AstMethodParameters) {
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object base = this.children[0].getValue(ctx); int propCount = this.jjtGetNumChildren(); int i = 1; Object suffix = null; getTypesFromValues(paramValues), paramValues); i+=2; } else {
final public void Value() throws ParseException { AstValue jjtn001 = new AstValue(JJTVALUE); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @since EL 2.2 */ @Override public boolean isParametersProvided() { // Assumption is that method parameters, if present, will be the last // child int len = children.length; if (len > 2) { if (this.jjtGetChild(len - 1) instanceof AstMethodParameters) { return true; } } return false; } }
Object[] paramValues) throws ELException { Target t = getTarget(ctx); Method m = null; Object[] values = null; Class<?>[] types = null; if (isParametersProvided()) { values = ((AstMethodParameters) this.jjtGetChild( this.jjtGetNumChildren() - 1)).getParameters(ctx); types = getTypesFromValues(values); } else { values = paramValues; values = convertArgs(values, m);
@Override // Interface el.parser.Node uses raw types (and is auto-generated) public MethodInfo getMethodInfo(EvaluationContext ctx, @SuppressWarnings("rawtypes") Class[] paramTypes) throws ELException { Target t = getTarget(ctx); Method m = ReflectionUtil.getMethod( t.base, t.property, paramTypes, null); return new MethodInfo(m.getName(), m.getReturnType(), m .getParameterTypes()); }