當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassReader.getSuperName方法代碼示例

本文整理匯總了Java中org.objectweb.asm.ClassReader.getSuperName方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassReader.getSuperName方法的具體用法?Java ClassReader.getSuperName怎麽用?Java ClassReader.getSuperName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.objectweb.asm.ClassReader的用法示例。


在下文中一共展示了ClassReader.getSuperName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getCommonClass

import org.objectweb.asm.ClassReader; //導入方法依賴的package包/類
private String getCommonClass(final ClassReader classReader1, final ClassReader classReader2) {
    final Set<String> classHierarchy = new HashSet<String>();
    classHierarchy.add(classReader1.getClassName());
    classHierarchy.add(classReader2.getClassName());

    String superClassInternalName1 = classReader1.getSuperName();
    if (!classHierarchy.add(superClassInternalName1)) {
        // find common super class.
        return superClassInternalName1;
    }

    String superClassInternalName2 = classReader2.getSuperName();
    if (!classHierarchy.add(superClassInternalName2)) {
        // find common super class.
        return superClassInternalName2;
    }

    while (superClassInternalName1 != null || superClassInternalName2 != null) {
        if (superClassInternalName1 != null) {
            superClassInternalName1 = getSuperClassInternalName(superClassInternalName1);
            if (superClassInternalName1 != null) {
                if (!classHierarchy.add(superClassInternalName1)) {
                    return superClassInternalName1;
                }
            }
        }

        if (superClassInternalName2 != null) {
            superClassInternalName2 = getSuperClassInternalName(superClassInternalName2);
            if (superClassInternalName2 != null) {
                if (!classHierarchy.add(superClassInternalName2)) {
                    return superClassInternalName2;
                }
            }
        }
    }

    return OBJECT_CLASS_INTERNAL_NAME;
}
 
開發者ID:willfleury,項目名稱:prometheus-metrics-agent,代碼行數:40,代碼來源:ASMClassWriter.java

示例4: getSuperClassInternalName

import org.objectweb.asm.ClassReader; //導入方法依賴的package包/類
private String getSuperClassInternalName(final String classInternalName) {
    final ClassReader classReader = getClassReader(classInternalName);
    if (classReader == null) {
        return null;
    }

    return classReader.getSuperName();
}
 
開發者ID:willfleury,項目名稱:prometheus-metrics-agent,代碼行數:9,代碼來源:ASMClassWriter.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

示例6: typeAncestors

import org.objectweb.asm.ClassReader; //導入方法依賴的package包/類
/**
 * Returns the internal names of the ancestor classes of the given type.
 *
 * @param type
 *            the internal name of a class or interface.
 * @param info
 *            the ClassReader corresponding to 'type'.
 * @return a StringBuilder containing the ancestor classes of 'type',
 *         separated by ';'. The returned string has the following format:
 *         ";type1;type2 ... ;typeN", where type1 is 'type', and typeN is a
 *         direct subclass of Object. If 'type' is Object, the returned
 *         string is empty.
 * @throws IOException
 *             if the bytecode of 'type' or of some of its ancestor class
 *             cannot be loaded.
 */
private StringBuilder typeAncestors(String type, ClassReader info)
        throws IOException {
    StringBuilder b = new StringBuilder();
    while (!"java/lang/Object".equals(type)) {
        b.append(';').append(type);
        type = info.getSuperName();
        info = typeInfo(type);
    }
    return b;
}
 
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:27,代碼來源:ComputeClassWriter.java


注:本文中的org.objectweb.asm.ClassReader.getSuperName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。