/** * Helper method that registers the methods of the given class. This method iterates over the methods of the class, * and calls {@link #getLookupKeyForMethod(Method)} for each. If this returns a string, the method is registered * using {@link #registerEndpoint(String,MethodEndpoint)}. * * @see #getLookupKeyForMethod(Method) */ protected void registerMethods(final String beanName) { Assert.hasText(beanName, "'beanName' must not be empty"); Class<?> endpointClass = getApplicationContext().getType(beanName); ReflectionUtils.doWithMethods(endpointClass, new ReflectionUtils.MethodCallback() { public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { T key = getLookupKeyForMethod(method); if (key != null) { registerEndpoint(key, new MethodEndpoint(beanName, getApplicationContext(), method)); } } }); }
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { T key = getLookupKeyForMethod(method); if (key != null) { registerEndpoint(key, new MethodEndpoint(beanName, getApplicationContext(), method)); } }
/** * Helper method that registers the methods of the given class. This method iterates over the methods of the class, * and calls {@link #getLookupKeyForMethod(Method)} for each. If this returns a string, the method is registered * using {@link #registerEndpoint(Object, MethodEndpoint)}. * * @see #getLookupKeyForMethod(Method) * @see #getLookupKeysForMethod(Method) */ protected void registerMethods(String beanName) { Assert.hasText(beanName, "'beanName' must not be empty"); Class<?> endpointType = getApplicationContext().getType(beanName); endpointType = ClassUtils.getUserClass(endpointType); Set<Method> methods = findEndpointMethods(endpointType, new ReflectionUtils.MethodFilter() { public boolean matches(Method method) { return !getLookupKeysForMethod(method).isEmpty(); } }); for (Method method : methods) { List<T> keys = getLookupKeysForMethod(method); for (T key : keys) { registerEndpoint(key, new MethodEndpoint(beanName, getApplicationContext(), method)); } } }
/** * Helper method that registers the methods of the given class. This method iterates over the methods of the class, * and calls {@link #getLookupKeyForMethod(Method)} for each. If this returns a string, the method is registered * using {@link #registerEndpoint(Object, MethodEndpoint)}. * * @see #getLookupKeyForMethod(Method) * @see #getLookupKeysForMethod(Method) */ protected void registerMethods(String beanName) { Assert.hasText(beanName, "'beanName' must not be empty"); Class<?> endpointType = getApplicationContext().getType(beanName); endpointType = ClassUtils.getUserClass(endpointType); Set<Method> methods = findEndpointMethods(endpointType, new ReflectionUtils.MethodFilter() { public boolean matches(Method method) { return !getLookupKeysForMethod(method).isEmpty(); } }); for (Method method : methods) { List<T> keys = getLookupKeysForMethod(method); for (T key : keys) { registerEndpoint(key, new MethodEndpoint(beanName, getApplicationContext(), method)); } } }
/** * Helper method that registers the methods of the given class. This method iterates over the methods of the class, * and calls {@link #getLookupKeyForMethod(Method)} for each. If this returns a string, the method is registered * using {@link #registerEndpoint(Object, MethodEndpoint)}. * * @see #getLookupKeyForMethod(Method) * @see #getLookupKeysForMethod(Method) */ protected void registerMethods(String beanName) { Assert.hasText(beanName, "'beanName' must not be empty"); Class<?> endpointType = getApplicationContext().getType(beanName); endpointType = ClassUtils.getUserClass(endpointType); Set<Method> methods = findEndpointMethods(endpointType, new ReflectionUtils.MethodFilter() { public boolean matches(Method method) { return !getLookupKeysForMethod(method).isEmpty(); } }); for (Method method : methods) { List<T> keys = getLookupKeysForMethod(method); for (T key : keys) { registerEndpoint(key, new MethodEndpoint(beanName, getApplicationContext(), method)); } } }