Refine search
static Constructor<?> findConstructor(Class<?> klass, Class<?>[] paramTypes, Object[] params) { if (paramTypes != null) { try { Constructor<?> c = klass.getConstructor(paramTypes); if (Modifier.isPublic(c.getModifiers())) { return c; } } catch (java.lang.NoSuchMethodException ex) { } throw new MethodNotFoundException("The constructor for class " + klass + " not found or accessible"); } int paramCount = (params == null)? 0: params.length; for (Constructor<?> c: klass.getConstructors()) { if (c.isVarArgs() || c.getParameterTypes().length==paramCount) { return c; } } throw new MethodNotFoundException("The constructor for class " + klass + " not found"); }
public Object invoke(ELContext context, Object[] params) { try { return this.orig.invoke(context, params); } catch (PropertyNotFoundException pnfe) { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); } catch (MethodNotFoundException mnfe) { throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause()); } catch (ELException e) { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); } }
public MethodInfo getMethodInfo(ELContext context) { try { return this.orig.getMethodInfo(context); } catch (PropertyNotFoundException pnfe) { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); } catch (MethodNotFoundException mnfe) { throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause()); } catch (ELException e) { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); } }
private final Object invokeTarget(EvaluationContext ctx, Object target, 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 + "' does not reference a MethodExpression instance, returned type: " + target.getClass().getName()); } }
private <T> T invoke(Invoker<T> invoker) { try { return invoker.invoke(); } catch (javax.faces.el.MethodNotFoundException e) { throw new MethodNotFoundException(e.getMessage(), e); } catch (EvaluationException e) { throw new ELException(e.getMessage(), e); } }
public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException { try { return m.invoke(ELAdaptor.getELContext(context), params); } catch (javax.el.MethodNotFoundException e) { throw new MethodNotFoundException(e.getMessage(), e.getCause()); } catch (ELException e) { throw new EvaluationException(e.getMessage(), e.getCause()); } }
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()); } }
@Override public Object getValue(ELContext context, Object base, Object property) { // If base is null, we're resolving it. Base should always be resolved as a value expression. if (base == null) { return super.getValue(context, null, property); } // Turn getValue calls into invoke. // Note 1: We can not directly delegate to invoke() here, since otherwise chained expressions // "like base.value.value.expression" will not resolve correctly. // // Note 2: Some EL implementations call getValue when invoke should be called already. This typically happens when the // method expression takes no parameters, but is specified with parentheses, e.g. "#{mybean.doAction()}". try { return super.getValue(context, base, property); } catch (PropertyNotFoundException ignore) { logger.log(FINEST, "Ignoring thrown exception; there is really no clean way to distinguish a ValueExpression from a MethodExpression.", ignore); try { return super.invoke(context, base, property, null, callerProvidedParameters != null ? callerProvidedParameters : EMPTY_PARAMETERS); } catch (MethodNotFoundException e) { // Wrap into new ELException since down the call chain, ElExceptions might be caught, unwrapped one level and then wrapped in // a new ELException. Without wrapping here, we'll then loose this exception. throw new ELException(e.getMessage(), e); } } } }
public JspMethodNotFoundException(String mark, MethodNotFoundException e) { super(mark + " " + e.getMessage(), e.getCause()); } }
public Object invoke(ELContext context, Object[] params) { try { return this.orig.invoke(context, params); } catch (PropertyNotFoundException pnfe) { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); } catch (MethodNotFoundException mnfe) { throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause()); } catch (ELException e) { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); } }
@Override public MethodInfo getMethodInfo(ELContext context) { try { return this.orig.getMethodInfo(context); } catch (PropertyNotFoundException pnfe) { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); } catch (MethodNotFoundException mnfe) { throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause()); } catch (ELException e) { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); } }
private final Object invokeTarget(EvaluationContext ctx, Object target, 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 + "' does not reference a MethodExpression instance, returned type: " + target.getClass().getName()); } }
private <T> T invoke(Invoker<T> invoker) { try { return invoker.invoke(); } catch (javax.faces.el.MethodNotFoundException e) { throw new MethodNotFoundException(e.getMessage(), e); } catch (EvaluationException e) { throw new ELException(e.getMessage(), e); } }
@Override public Object invoke(FacesContext context, 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()); } }
@Override 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()); } }
@Override public Object getValue(ELContext context, Object base, Object property) { // If base is null, we're resolving it. Base should always be resolved as a value expression. if (base == null) { return super.getValue(context, null, property); } // Turn getValue calls into invoke. // Note 1: We can not directly delegate to invoke() here, since otherwise chained expressions // "like base.value.value.expression" will not resolve correctly. // // Note 2: Some EL implementations call getValue when invoke should be called already. This typically happens when the // method expression takes no parameters, but is specified with parentheses, e.g. "#{mybean.doAction()}". try { return super.getValue(context, base, property); } catch (PropertyNotFoundException ignore) { logger.log(FINEST, "Ignoring thrown exception; there is really no clean way to distinguish a ValueExpression from a MethodExpression.", ignore); try { return super.invoke(context, base, property, null, callerProvidedParameters != null ? callerProvidedParameters : EMPTY_PARAMETERS); } catch (MethodNotFoundException e) { // Wrap into new ELException since down the call chain, ElExceptions might be caught, unwrapped one level and then wrapped in // a new ELException. Without wrapping here, we'll then loose this exception. throw new ELException(e.getMessage(), e); } } } }
public JspMethodNotFoundException(String mark, MethodNotFoundException e) { super(mark + " " + e.getMessage(), e.getCause()); } }
@Override public Object invoke(ELContext context, Object[] params) { try { return this.orig.invoke(context, params); } catch (PropertyNotFoundException pnfe) { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); } catch (MethodNotFoundException mnfe) { throw new MethodNotFoundException(this.attr + ": " + mnfe.getMessage(), mnfe.getCause()); } catch (ELException e) { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); } }
@Override public MethodInfo getMethodInfo(final ELContext context) { 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()); } }
private final Object invokeTarget(EvaluationContext ctx, Object target, 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 + "' does not reference a MethodExpression instance, returned type: " + target.getClass().getName()); } }