當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。