List<Method> filtered = filter.filter(methods); methods = (filtered instanceof ArrayList ? (ArrayList<Method>) filtered : new ArrayList<>(filtered));
List<Method> filtered = filter.filter(methods); methods = (filtered instanceof ArrayList ? (ArrayList<Method>) filtered : new ArrayList<>(filtered));
private void validateMethod(Object targetObject, String name, int argumentCount) { if (this.methodFilter == null) { return; } Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass()); Method[] methods = type.getMethods(); List<Method> candidates = new ArrayList<Method>(); for (Method method : methods) { if (method.getName().equals(name) && method.getParameterTypes().length == argumentCount) { candidates.add(method); } } List<Method> supportedMethods = this.methodFilter.filter(candidates); if (supportedMethods.size() == 0) { String methodDescription = (candidates.size() > 0) ? candidates.get(0).toString() : name; throw new EvaluationException("The method '" + methodDescription + "' is not supported by this command processor. " + "If using the Control Bus, consider adding @ManagedOperation or @ManagedAttribute."); } } }
private void validateMethod(Object targetObject, String name, int argumentCount) { if (this.methodFilter == null) { return; } Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass()); Method[] methods = type.getMethods(); List<Method> candidates = new ArrayList<Method>(); for (Method method : methods) { if (method.getName().equals(name) && method.getParameterTypes().length == argumentCount) { candidates.add(method); } } List<Method> supportedMethods = this.methodFilter.filter(candidates); if (supportedMethods.size() == 0) { String methodDescription = (candidates.size() > 0) ? candidates.get(0).toString() : name; throw new EvaluationException("The method '" + methodDescription + "' is not supported by this command processor. " + "If using the Control Bus, consider adding @ManagedOperation or @ManagedAttribute."); } } }
List<Method> filtered = filter.filter(methods); methods = (filtered instanceof ArrayList ? (ArrayList<Method>) filtered : new ArrayList<>(filtered));