Examples of MethodCallback


Examples of org.springframework.util.ReflectionUtils.MethodCallback

    return bean;
  }

  public Object postProcessAfterInitialization(final Object bean, String beanName) {
    Class<?> targetClass = AopUtils.getTargetClass(bean);
    ReflectionUtils.doWithMethods(targetClass, new MethodCallback() {
      public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
        Scheduled annotation = AnnotationUtils.getAnnotation(method, Scheduled.class);
        if (annotation != null) {
          Assert.isTrue(void.class.equals(method.getReturnType()),
              "Only void-returning methods may be annotated with @Scheduled.");
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

        }
      });
    }

    private void addIdMethodToCache(final Class<?> valueClass) {
      ReflectionUtils.doWithMethods(valueClass, new MethodCallback() {
        public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
          if (AnnotationUtils.getAnnotation(method, Id.class) != null) {
            method.setAccessible(true);
            HasJpa.this.cache.put(valueClass, method);
          }
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    }
    final AtomicReference<Method> found = new AtomicReference<Method>(null);
    MetaData meta = this.beans.get(beanName);
    final String factory = meta.getMethod();
    Class<?> type = this.beanFactory.getType(meta.getBean());
    ReflectionUtils.doWithMethods(type, new MethodCallback() {
      @Override
      public void doWith(Method method) throws IllegalArgumentException,
          IllegalAccessException {
        if (method.getName().equals(factory)) {
          found.compareAndSet(null, method);
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

          // We should be safe to load at this point since we are in the
          // REGISTER_BEAN phase
          Class<?> configClass = ClassUtils.forName(
              methodMetadata.getDeclaringClassName(),
              context.getClassLoader());
          ReflectionUtils.doWithMethods(configClass, new MethodCallback() {
            @Override
            public void doWith(Method method)
                throws IllegalArgumentException, IllegalAccessException {
              if (methodMetadata.getMethodName().equals(method.getName())) {
                beanTypes.add(method.getReturnType().getName());
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

      Class<?> c = delegate.getClass();

      methods = new ArrayList<Method>();

      ReflectionUtils.doWithMethods(c, new MethodCallback() {

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

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    final List<ModelFieldBean> modelFields = new ArrayList<ModelFieldBean>();
    final List<AbstractAssociation> associations = new ArrayList<AbstractAssociation>();

    if (clazz.isInterface()) {
      ReflectionUtils.doWithMethods(clazz, new MethodCallback() {
        @Override
        public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
          createModelBean(model, method, modelFields, associations, outputConfig);
        }
      });
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

      this.lenient = delegate instanceof MessageListener;
      this.methods = new HashSet<Method>();

      final Class<?> c = delegate.getClass();

      ReflectionUtils.doWithMethods(c, new MethodCallback() {

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

Examples of org.springframework.util.ReflectionUtils.MethodCallback

  /* Operations */

  public void registerAnnotationBasedActions() {
    final ConfigurableListableBeanFactory beanFactory = getBeanFactory();
    for (final String beanName : beanFactory.getBeanDefinitionNames()) {
      ReflectionUtils.doWithMethods(beanFactory.getType(beanName), new MethodCallback() {

        @Override
        public void doWith(final Method method) throws IllegalArgumentException, IllegalAccessException {
          final ActionMethod actionMethod = AnnotationUtils.findAnnotation(method, ActionMethod.class);
          if (actionMethod != null) {
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        final AtomicBoolean add = new AtomicBoolean();
        ReflectionUtils.doWithMethods(bean.getClass(),
                new MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException,
            IllegalAccessException {
                add.set(true);
            }
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        final AtomicBoolean add = new AtomicBoolean();
        ReflectionUtils.doWithMethods(bean.getClass(),
                new MethodCallback() {
            @Override
            public void doWith(Method method) throws IllegalArgumentException,
            IllegalAccessException {
                add.set(true);
            }
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.