| Method from org.apache.el.parser.AstValue Detail: |
public MethodInfo getMethodInfo(EvaluationContext ctx,
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());
}
|
public Class getType(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
return ctx.getELResolver().getType(ctx, 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 {
ctx.setPropertyResolved(false);
base = resolver.getValue(ctx, base, property);
}
i++;
}
return base;
}
|
public Object invoke(EvaluationContext ctx,
Class[] paramTypes,
Object[] paramValues) throws ELException {
Target t = getTarget(ctx);
Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
Object result = null;
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;
}
|
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
return ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
}
|
public void setValue(EvaluationContext ctx,
Object value) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
ELResolver resolver = ctx.getELResolver();
resolver.setValue(ctx, t.base, t.property,
// coerce to the expected type
ELSupport.coerceToType(value,
resolver.getType(ctx, t.base, t.property)));
}
|