protected AstIdentifier createAstIdentifier(String name, int index) { return new AstIdentifier(name, index); }
public MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Method method = getMethod(bindings, context, returnType, paramTypes); return new MethodInfo(method.getName(), method.getReturnType(), paramTypes); }
protected Method getMethod(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Object value = eval(bindings, context); if (value == null) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (value instanceof Method) { Method method = (Method)value; if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (!Arrays.equals(method.getParameterTypes(), paramTypes)) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } return method; } throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notamethod", name, value.getClass())); }
protected Method getMethod(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Object value = eval(bindings, context); if (value == null) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (value instanceof Method) { Method method = (Method)value; if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (!Arrays.equals(method.getParameterTypes(), paramTypes)) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } return method; } throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notamethod", name, value.getClass())); }
public MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Method method = getMethod(bindings, context, returnType, paramTypes); return new MethodInfo(method.getName(), method.getReturnType(), paramTypes); }
protected AstIdentifier createAstIdentifier(String name, int index) { return new AstIdentifier(name, index); }
protected Method getMethod(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Object value = eval(bindings, context); if (value == null) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (value instanceof Method) { Method method = (Method)value; if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } if (!Arrays.equals(method.getParameterTypes(), paramTypes)) { throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name)); } return method; } throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notamethod", name, value.getClass())); }
public Object invoke(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes, Object[] params) { Method method = getMethod(bindings, context, returnType, paramTypes); try { return method.invoke(null, params); } catch (IllegalAccessException e) { throw new ELException(LocalMessages.get("error.identifier.method.access", name)); } catch (IllegalArgumentException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e)); } catch (InvocationTargetException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e.getCause())); } }
protected AstIdentifier createAstIdentifier(String name, int index) { return new AstIdentifier(name, index); }
public Object invoke(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes, Object[] params) { Method method = getMethod(bindings, context, returnType, paramTypes); try { return method.invoke(null, params); } catch (IllegalAccessException e) { throw new ELException(LocalMessages.get("error.identifier.method.access", name)); } catch (IllegalArgumentException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e)); } catch (InvocationTargetException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e.getCause())); } }
public MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) { Method method = getMethod(bindings, context, returnType, paramTypes); return new MethodInfo(method.getName(), method.getReturnType(), paramTypes); }
public Object invoke(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes, Object[] params) { Method method = getMethod(bindings, context, returnType, paramTypes); try { return method.invoke(null, params); } catch (IllegalAccessException e) { throw new ELException(LocalMessages.get("error.identifier.method.access", name)); } catch (IllegalArgumentException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e)); } catch (InvocationTargetException e) { throw new ELException(LocalMessages.get("error.identifier.method.invocation", name, e.getCause())); } }