Java 类net.minecraftforge.fml.relauncher.ReflectionHelper.UnableToFindMethodException 实例源码

项目:VillagerInventory    文件:ReflectionHelper.java   
/**
 * Obtain a Method by name from class declaringClass.
 * Simplified version of {@link net.minecraftforge.fml.relauncher.ReflectionHelper#findMethod(Class, Object, String[], Class...)}.
 */
public static final Method getDeclaredMethod(final Class<?> declaringClass, String[] methodNames, Class<?>... parameterTypes)
{
    Exception failed = null;
    for (String methodName : methodNames)
    {
        try
        {
            Method method = declaringClass.getDeclaredMethod(methodName, parameterTypes);
            method.setAccessible(true);
            return method;
        }
        catch (Exception ex)
        {
            failed = ex;
        }
    }
    throw new UnableToFindMethodException(methodNames, failed);
}
项目:Halloween    文件:ReflectionUtils.java   
/**
 * Obtain a Method by name from class declaringClass.
 * Simplified version of {@link net.minecraftforge.fml.relauncher.ReflectionHelper#findMethod(Class, Object, String[], Class...)}.
 */
public static final Method getDeclaredMethod(final Class<?> declaringClass, String[] methodNames, Class<?>... parameterTypes)
{
    Exception failed = null;
    for (String methodName : methodNames)
    {
        try
        {
            Method method = declaringClass.getDeclaredMethod(methodName, parameterTypes);
            method.setAccessible(true);
            return method;
        }
        catch (Exception ex)
        {
            failed = ex;
        }
    }
    throw new UnableToFindMethodException(methodNames, failed);
}
项目:itemscroller    文件:MethodHandleUtils.java   
public static <E> Method reflectMethod(Class<? super E> clazz, String[] methodNames, Class<?>... methodTypes)
{
    Exception failed = null;

    for (String methodName : methodNames)
    {
        try
        {
            Method m = clazz.getDeclaredMethod(methodName, methodTypes);
            m.setAccessible(true);
            return m;
        }
        catch (Exception e)
        {
            failed = e;
        }
    }

    throw new UnableToFindMethodException(methodNames, failed);
}
项目:justenoughdimensions    文件:MethodHandleUtils.java   
public static <E> Method reflectMethod(Class<? super E> clazz, String[] methodNames, Class<?>... methodTypes)
{
    Exception failed = null;

    for (String methodName : methodNames)
    {
        try
        {
            Method m = clazz.getDeclaredMethod(methodName, methodTypes);
            m.setAccessible(true);
            return m;
        }
        catch (Exception e)
        {
            failed = e;
        }
    }

    throw new UnableToFindMethodException(methodNames, failed);
}
项目:multishot    文件:MethodHandleUtils.java   
public static <E> Method reflectMethod(Class<? super E> clazz, String[] methodNames, Class<?>... methodTypes)
{
    Exception failed = null;

    for (String methodName : methodNames)
    {
        try
        {
            Method m = clazz.getDeclaredMethod(methodName, methodTypes);
            m.setAccessible(true);
            return m;
        }
        catch (Exception e)
        {
            failed = e;
        }
    }

    throw new UnableToFindMethodException(methodNames, failed);
}
项目:enderutilities    文件:MethodHandleUtils.java   
public static <E> Method reflectMethod(Class<? super E> clazz, String[] methodNames, Class<?>... methodTypes)
{
    Exception failed = null;

    for (String methodName : methodNames)
    {
        try
        {
            Method m = clazz.getDeclaredMethod(methodName, methodTypes);
            m.setAccessible(true);
            return m;
        }
        catch (Exception e)
        {
            failed = e;
        }
    }

    throw new UnableToFindMethodException(methodNames, failed);
}