Java Method Call invokeTargetMethods(Object obj, T data, List methods)

Here you can find the source of invokeTargetMethods(Object obj, T data, List methods)

Description

invoke Target Methods

License

Open Source License

Declaration

static <T> void invokeTargetMethods(Object obj, T data,
            List<Method> methods) throws IllegalAccessException,
            IllegalArgumentException, InvocationTargetException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

import java.util.List;

public class Main {
    static <T> void invokeTargetMethods(Object obj, T data,
            List<Method> methods) throws IllegalAccessException,
            IllegalArgumentException, InvocationTargetException {
        for (Method target : methods) {
            for (Parameter paramType : target.getParameters()) {
                Class<?> parClass = paramType.getType();
                if (parClass.isAssignableFrom(data.getClass())) {
                    target.invoke(obj, data);
                }//from  w  w  w.ja v  a  2 s  .  c  om

            }
        }
    }
}

Related

  1. invokeSetFieldValue(Object bean, Field field, Object value)
  2. invokeSilent(Object obj, String methodName, Class[] parameterTypes, Object[] args)
  3. invokeSimple(Object target, String name)
  4. invokeTarget(Method method, Object obj, Object... args)
  5. invokeTargetCheckPoint(String resuming_checkpoint_path, Object jobObject, final java.util.Map globalMap)
  6. invokeToStringMethod(Object value, Class type)
  7. invokeUnchecked(Method method, Object target, Object... arguments)
  8. invokeUnwrapException(final Object target, final Method method, @Nullable final Object[] args)
  9. invokeValue(AnnotatedElement element, Class annotationClass)