Package org.springframework.util.ReflectionUtils

Examples of org.springframework.util.ReflectionUtils.MethodFilter


    // Avoid repeated calls to getMappingForMethod which would rebuild RequestMappingInfo instances
    final Map<Method, T> mappings = new IdentityHashMap<Method, T>();
    final Class<?> userType = ClassUtils.getUserClass(handlerType);

    Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
      @Override
      public boolean matches(Method method) {
        T mapping = getMappingForMethod(method, userType);
        if (mapping != null) {
          mappings.put(method, mapping);
View Full Code Here


      }
    }
  }

  private void detectNavigationMethods(final String beanName, final Class<?> beanType) {
    Set<Method> methods = HandlerMethodSelector.selectMethods(beanType, new MethodFilter() {
      public boolean matches(Method method) {
        return AnnotationUtils.findAnnotation(method, NavigationMapping.class) != null;
      }
    });
    boolean controllerBeanMethod = isControllerBean(beanType);
View Full Code Here

    final Map<Class<? extends CommandMarker>, Map<CliCommand, List<CliOption>>> plugins = new TreeMap<Class<? extends CommandMarker>, Map<CliCommand, List<CliOption>>>(
        comparator);

    Map<String, CommandMarker> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(ctx, CommandMarker.class);
    final MethodFilter filter = new MethodFilter() {

      @Override
      public boolean matches(Method method) {
        return method.getAnnotation(CliCommand.class) != null;
      }
View Full Code Here

      if (EXCLUDES.contains(it.next().getClass())) {
        it.remove();
      }
    }

    final MethodFilter commandMethodfilter = new AnnotationBearingMethodFilter(CliCommand.class);

    final MethodFilter availabilityMethodfilter = new AnnotationBearingMethodFilter(CliAvailabilityIndicator.class);

    for (CommandMarker plugin : beans) {
      Set<String> commandNames = new TreeSet<String>();
      Set<String> namesUsedInAvailabilityIndicator = new TreeSet<String>();
      ReflectionUtils.doWithMethods(plugin.getClass(),
View Full Code Here

    for (String beanName : beanNames) {

      Class<?> handlerType = context.getType(beanName);
      final Class<?> userType = ClassUtils.getUserClass(handlerType);

      Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
        @Override
        public boolean matches(Method method) {
          return AnnotationUtils.findAnnotation(method, ExtDirectMethod.class) != null;
        }
      });
View Full Code Here

    for (String beanName : beanNames) {

      Class<?> handlerType = context.getType(beanName);
      final Class<?> userType = ClassUtils.getUserClass(handlerType);

      Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
        @Override
        public boolean matches(Method method) {
          return AnnotationUtils.findAnnotation(method, ExtDirectMethod.class) != null;
        }
      });
View Full Code Here

    for (String beanName : beanNames) {

      Class<?> handlerType = context.getType(beanName);
      final Class<?> userType = ClassUtils.getUserClass(handlerType);

      Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
        @Override
        public boolean matches(Method method) {
          return AnnotationUtils.findAnnotation(method, ExtDirectMethod.class) != null;
        }
      });
View Full Code Here

      Class<?> handlerType = context.getType(beanName);
      final Class<?> userType = ClassUtils.getUserClass(handlerType);

      Set<Method> methods = HandlerMethodSelector.selectMethods(userType,
          new MethodFilter() {
            @Override
            public boolean matches(Method method) {
              return AnnotationUtils.findAnnotation(method,
                  ExtDirectMethod.class) != null;
            }
View Full Code Here

          public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
            ReflectionUtils.makeAccessible(method);
            methods.add(method);
          }

        }, new MethodFilter() {
          public boolean matches(Method method) {
            if (Modifier.isPublic(method.getModifiers()) && methodName.equals(method.getName())) {

              // check out the arguments
              Class<?>[] parameterTypes = method.getParameterTypes();
View Full Code Here

            public void doWith(Method method) throws IllegalArgumentException,
            IllegalAccessException {
                add.set(true);
            }
        },
        new MethodFilter() {
            @Override
            public boolean matches(Method method) {
                for (Class<? extends Annotation> annotationClass : annotations) {
                    if (method.isAnnotationPresent(annotationClass)) {
                        return true;
View Full Code Here

TOP

Related Classes of org.springframework.util.ReflectionUtils.MethodFilter

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.