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


Java ClassReader.getInterfaces方法代码示例

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


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

示例1: typeImplements

import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
/**
 * Returns true if the given type implements the given interface.
 *
 * @param type
 *            the internal name of a class or interface.
 * @param info
 *            the ClassReader corresponding to 'type'.
 * @param itf
 *            the internal name of a interface.
 * @return true if 'type' implements directly or indirectly 'itf'
 * @throws IOException
 *             if the bytecode of 'type' or of some of its ancestor class
 *             cannot be loaded.
 */
private boolean typeImplements(String type, ClassReader info, String itf)
        throws IOException {
    while (!"java/lang/Object".equals(type)) {
        String[] itfs = info.getInterfaces();
        for (int i = 0; i < itfs.length; ++i) {
            if (itfs[i].equals(itf)) {
                return true;
            }
        }
        for (int i = 0; i < itfs.length; ++i) {
            if (typeImplements(itfs[i], typeInfo(itfs[i]), itf)) {
                return true;
            }
        }
        type = info.getSuperName();
        info = typeInfo(type);
    }
    return false;
}
 
开发者ID:arcuri82,项目名称:testing_security_development_enterprise_systems,代码行数:34,代码来源:ComputeClassWriter.java

示例2: findAndMergeSuperMaps

import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
private void findAndMergeSuperMaps(String name)
{
    try
    {
        String superName = null;
        String[] interfaces = new String[0];
        byte[] classBytes = ClassPatchManager.INSTANCE.getPatchedResource(name, map(name), classLoader);
        if (classBytes != null)
        {
            ClassReader cr = new ClassReader(classBytes);
            superName = cr.getSuperName();
            interfaces = cr.getInterfaces();
        }
        mergeSuperMaps(name, superName, interfaces);
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:FMLDeobfuscatingRemapper.java

示例3: traversalInterfaceHierarchy

import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
private void traversalInterfaceHierarchy(final Set<String> interfaceHierarchy, final ClassReader classReader) {
    if (classReader != null && interfaceHierarchy.add(classReader.getClassName())) {
        for (String interfaceInternalName : classReader.getInterfaces()) {
            traversalInterfaceHierarchy(interfaceHierarchy, getClassReader(interfaceInternalName));
        }
    }
}
 
开发者ID:willfleury,项目名称:prometheus-metrics-agent,代码行数:8,代码来源:ASMClassWriter.java

示例4: excludeJavaMethods

import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
void excludeJavaMethods(ClassReader classReader, Set<String> methods) {
	// premier filtre : si mode public, on exclue
	// les méthodes qui implémentent ou surchargent une méthode Java,
	// par exemple actionPerformed, equals, hashCode
	// (le filtre final sera fait dans filterJavaMethods)
	if (DcdHelper.isJavaClass(classReader.getSuperName())) {
		excludeJavaMethods(methods, classReader.getSuperName());
	} else {
		methods.removeAll(javaLangObjectMethods);
	}
	for (final String interfaceName : classReader.getInterfaces()) {
		excludeJavaMethods(methods, interfaceName);
	}
}
 
开发者ID:evernat,项目名称:dead-code-detector,代码行数:15,代码来源:Result.java

示例5: registerHierarchyOfClass

import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
private void registerHierarchyOfClass(ClassReader classReader) {
	final String asmClassName = classReader.getClassName();
	final String asmSuperClassName = classReader.getSuperName();
	if (isPublicIndexationStep() || !DcdHelper.isJavaClass(asmSuperClassName)) {
		// les classes java et javax ne sont pas auditées
		result.registerSuperClass(asmSuperClassName, asmClassName);
		result.registerSubClass(asmSuperClassName, asmClassName);
		if (isPublicIndexationStep()) {
			for (final String asmInterfaceName : classReader.getInterfaces()) {
				result.registerSubClass(asmInterfaceName, asmClassName);
			}
		}
	}
}
 
开发者ID:evernat,项目名称:dead-code-detector,代码行数:15,代码来源:DeadCodeDetector.java


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