Package org.springframework.util.ReflectionUtils

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


    }
    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

          // 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

      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

    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

      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

  /* 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

    @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

    @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

    final AtomicReference<java.lang.reflect.Method> getFlowMethod = new AtomicReference<java.lang.reflect.Method>();
    final AtomicReference<java.lang.reflect.Method> flowMethod = new AtomicReference<java.lang.reflect.Method>();
    final AtomicReference<java.lang.reflect.Method> flowBlockedMethod = new AtomicReference<java.lang.reflect.Method>();
    final AtomicReference<java.lang.reflect.Method> basicConsumeFourArgsMethod = new AtomicReference<java.lang.reflect.Method>();
    final AtomicReference<java.lang.reflect.Method> basicQosTwoArgsMethod = new AtomicReference<java.lang.reflect.Method>();
    ReflectionUtils.doWithMethods(delegate.getClass(), new MethodCallback(){

      @Override
      public void doWith(java.lang.reflect.Method method) throws IllegalArgumentException, IllegalAccessException {
        if ("getFlow".equals(method.getName()) && method.getParameterTypes().length == 0
            && FlowOk.class.equals(method.getReturnType())) {
View Full Code Here

TOP

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

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.