当前位置: 首页>>代码示例>>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;未经允许,请勿转载。