Examples of MethodNotFoundException


Examples of javax.el.MethodNotFoundException

    // 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

Examples of javax.el.MethodNotFoundException

//                m = new MethodCache(type);
//                methodCache.set(type, m);
//            }
            r = m.findMethod(methodName, params);
            if (r == null) {
                throw new MethodNotFoundException(MessageFactory.get(
                        "error.method.notfound", base, name,
                        paramString(paramTypes(params))));
            }
        } else {
            throw new MethodNotFoundException();
        }
        return r;
    }
View Full Code Here

Examples of javax.el.MethodNotFoundException

     * @throws MethodNotFoundException
     */
    public static Method getMethod(Object base, Object property,
            Class[] paramTypes) throws MethodNotFoundException {
        if (base == null || property == null) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }
       
        String methodName = (property instanceof String) ? (String) property
                : property.toString();
       
        Method method = null;
        try {
            method = base.getClass().getMethod(methodName, paramTypes);
        } catch (NoSuchMethodException nsme) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }
        return method;
    }
View Full Code Here

Examples of javax.el.MethodNotFoundException

    }
   
    private static final Object[] EMPTY_PARAMS = new Object[0];
   
    public static Object invokeMethod(Object base, Method m, Object[] paramValues) throws ELException {
        if (m == null) throw new MethodNotFoundException();
       
        Class[] paramTypes = m.getParameterTypes();
        Object[] params = null;
       
        if (paramTypes.length == 0) {
            // leave params null
        } else if (paramValues == null) {
            throw new MethodNotFoundException(m.getDeclaringClass() + "." + m.getName() + " has " + paramTypes.length + " params");
        } else if (m.isVarArgs()) {
            // add values
            params = new Object[paramTypes.length];
           
            int i = 0;
            for (; i < paramTypes.length - 1; i++) {
                params[i] = ELSupport.coerceToType(paramValues[i], paramTypes[i]);
            }
           
            Class argType = paramTypes[i].getComponentType();
            if (paramTypes.length == paramValues.length) {
                if (paramValues[i] == null) {
                    params[i] = Array.newInstance(argType, 0);
                } else if (paramValues[i].getClass().isArray()) {
                    params[i] = paramValues[i];
                } else {
                    params[i] = Array.newInstance(argType, 1);
                    Array.set(params[i], 0, ELSupport.coerceToType(paramValues[i], argType));
                }
            } else {
                int len = paramValues.length - paramTypes.length + 1;
                Object ar = Array.newInstance(argType, len);
                for (int j = 0; j < len; j++) {
                    Array.set(ar, j, ELSupport.coerceToType(paramValues[paramTypes.length - 1 + j], argType));
                }
                params[i] = ar;
            }
        } else if (paramValues.length == paramTypes.length) {
            // add values
            params = new Object[paramTypes.length];
           
            // assign first set
            for (int i = 0; i < paramTypes.length; i++) {
                params[i] = ELSupport.coerceToType(paramValues[i], paramTypes[i]);
            }
        } else {
            throw new MethodNotFoundException(m.getDeclaringClass().getName() + "." + m.getName() + " has " + paramTypes.length + ", only passed " + paramValues.length + " parameters");
        }
       
        try {
            return m.invoke(base, params);
        } catch (IllegalAccessException iae) {
View Full Code Here

Examples of javax.el.MethodNotFoundException

     * @throws MethodNotFoundException
     */
    public static Method getMethod(Object base, Object property,
            Class[] paramTypes) throws MethodNotFoundException {
        if (base == null || property == null) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }

        String methodName = (property instanceof String) ? (String) property
                : property.toString();

        Method method = null;
        try {
            method = base.getClass().getMethod(methodName, paramTypes);
        } catch (NoSuchMethodException nsme) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }
        return method;
    }
View Full Code Here

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

Examples of javax.el.MethodNotFoundException

        // 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

Examples of javax.el.MethodNotFoundException

     * @throws MethodNotFoundException
     */
    public static Method getMethod(Object base, Object property,
            Class[] paramTypes) throws MethodNotFoundException {
        if (base == null || property == null) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }

        String methodName = (property instanceof String) ? (String) property
                : property.toString();

        Method method = null;
        try {
            method = base.getClass().getMethod(methodName, paramTypes);
        } catch (NoSuchMethodException nsme) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }
        return method;
    }
View Full Code Here

Examples of javax.faces.el.MethodNotFoundException

        public Class getType(FacesContext context) throws MethodNotFoundException {
            try {
                return m.getMethodInfo(context.getELContext()).getReturnType();
            } catch (javax.el.MethodNotFoundException e) {
                throw new MethodNotFoundException(e.getMessage(),
                                                  e.getCause());
            } catch (ELException e) {
                throw new EvaluationException(e.getMessage(), e.getCause());
            }
        }
View Full Code Here

Examples of javax.faces.el.MethodNotFoundException

                             Object[] params) throws EvaluationException,
                                                     MethodNotFoundException {
            try {
                return m.invoke(context.getELContext(), params);
            } catch (javax.el.MethodNotFoundException e) {
                throw new MethodNotFoundException(e.getMessage(),
                                                  e.getCause());
            } catch (ELException e) {
                throw new EvaluationException(e.getMessage(), e.getCause());
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.