Package javax.el

Examples of javax.el.MethodNotFoundException


            Object[] paramValues) throws ELException {
        if (target instanceof MethodExpression) {
            MethodExpression me = (MethodExpression) target;
            return me.invoke(ctx.getELContext(), paramValues);
        } else if (target == null) {
            throw new MethodNotFoundException("Identity '" + this.image
                    + "' was null and was unable to invoke");
        } else {
            throw new ELException(
                    "Identity '"
                            + this.image
View Full Code Here


        // finally provide helpful hints
        if (obj instanceof MethodExpression) {
            return (MethodExpression) obj;
        } else if (obj == null) {
            throw new MethodNotFoundException("Identity '" + this.image
                    + "' was null and was unable to invoke");
        } else {
            throw new ELException(
                    "Identity '"
                            + this.image
View Full Code Here

  private <T> T invoke(final Invoker<T> invoker) {
    try {
      return invoker.invoke();
    } catch (final javax.faces.el.MethodNotFoundException e) {
      throw new MethodNotFoundException(e.getMessage(), e);
    } catch (final EvaluationException e) {
      throw new ELException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      return this.orig.getMethodInfo(context);
    } catch (final PropertyNotFoundException pnfe) {
      throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause());
    } catch (final MethodNotFoundException mnfe) {
      throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause());
    } catch (final ELException e) {
      throw new ELException(this.attr + ": " + e.getMessage(), e.getCause());
    }
  }
View Full Code Here

    try {
      return this.orig.invoke(context, params);
    } catch (final PropertyNotFoundException pnfe) {
      throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause());
    } catch (final MethodNotFoundException mnfe) {
      throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause());
    } catch (final ELException e) {
      throw new ELException(this.attr + ": " + e.getMessage(), e.getCause());
    }
  }
View Full Code Here

        {
            return invoker.invoke();
        }
        catch (javax.faces.el.MethodNotFoundException e)
        {
            throw new MethodNotFoundException(e.getMessage(), e);
        }
        catch (EvaluationException e)
        {
            throw new ELException(e.getMessage(), e);
        }
View Full Code Here

    paramValues = params.eval(bindings, context);

    context.setPropertyResolved(false);
    Object result = context.getELResolver().invoke(context, base, name, paramTypes, paramValues);
    if (!context.isPropertyResolved()) {
      throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, base.getClass()));
    }
//    if (returnType != null && !returnType.isInstance(result)) { // should we check returnType for method invocations?
//      throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, base.getClass()));
//    }
    return result;
View Full Code Here

  protected Method findMethod(String name, Class<?> clazz, Class<?> returnType, Class<?>[] paramTypes) {
    Method method = null;
    try {
      method = clazz.getMethod(name, paramTypes);
    } catch (NoSuchMethodException e) {
      throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, clazz));
    }
    if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) {
      throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, clazz));
    }
    return method;
  }
View Full Code Here

  }

  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()));
  }
View Full Code Here

        {
            return invoker.invoke();
        }
        catch (javax.faces.el.MethodNotFoundException e)
        {
            throw new MethodNotFoundException(e.getMessage(), e);
        }
        catch (EvaluationException e)
        {
            throw new ELException(e.getMessage(), e);
        }
View Full Code Here

TOP

Related Classes of javax.el.MethodNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.