当前位置: 首页>>代码示例>>Java>>正文


Java ReflectionHelper.UnableToFindMethodException方法代码示例

本文整理汇总了Java中cpw.mods.fml.relauncher.ReflectionHelper.UnableToFindMethodException方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionHelper.UnableToFindMethodException方法的具体用法?Java ReflectionHelper.UnableToFindMethodException怎么用?Java ReflectionHelper.UnableToFindMethodException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.relauncher.ReflectionHelper的用法示例。


在下文中一共展示了ReflectionHelper.UnableToFindMethodException方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMethod

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static Method getMethod(Class<?> clazz, String... names) {
    try {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            for (String methodName : names) {
                if (method.getName().equalsIgnoreCase(methodName)) {
                    method.setAccessible(true);
                    return method;
                }
            }
        }
    } catch (Exception e) {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return null;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:17,代码来源:ObfUtil.java

示例2: isMethodAccessable

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static boolean isMethodAccessable(Class<?> clazz, String... names)
{
    try
    {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            for (String methodName : names) {
                if (method.getName().equalsIgnoreCase(methodName)) {
                    return method.isAccessible();
                }
            }
        }
    }
    catch (Exception e)
    {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return false;
}
 
开发者ID:AdvancedMods,项目名称:AMCore,代码行数:20,代码来源:ObfUtil.java

示例3: getMethod

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static Method getMethod(Class<?> clazz, String... names)
{
    try
    {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            for (String methodName : names) {
                if (method.getName().equalsIgnoreCase(methodName))
                {
                    method.setAccessible(true);
                    return method;
                }
            }
        }
    }
    catch (Exception e)
    {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return null;
}
 
开发者ID:AdvancedMods,项目名称:AMCore,代码行数:22,代码来源:ObfUtil.java

示例4: isMethodAccessable

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static boolean isMethodAccessable(Class<?> clazz, String... names) {
    try {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            for (String methodName : names) {
                if (method.getName().equalsIgnoreCase(methodName))
                    return method.isAccessible();
            }
        }
    } catch (Exception e) {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return false;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:15,代码来源:ObfUtil.java

示例5: invokeMethod

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static <T, E> Object invokeMethod(Class<? extends E> clazz, E instance, String[] names, Object... args) {
    try {
        Method method = getMethod(clazz, names);
        if (method != null)
            return method.invoke(instance, args);
    } catch (Exception e) {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return null;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:11,代码来源:ObfUtil.java

示例6: invokeMethod

import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
public static <T, E> Object invokeMethod(Class<? extends E> clazz, E instance, String[] names, Object... args)
{
    try
    {
        Method method = getMethod(clazz, names);
        if (method != null) {
            return method.invoke(instance, args);
        }
    }
    catch (Exception e)
    {
        throw new ReflectionHelper.UnableToFindMethodException(names, e);
    }
    return null;
}
 
开发者ID:AdvancedMods,项目名称:AMCore,代码行数:16,代码来源:ObfUtil.java


注:本文中的cpw.mods.fml.relauncher.ReflectionHelper.UnableToFindMethodException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。