本文整理汇总了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();
}
}
示例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));
}
}
}
示例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);
}
}
示例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);
}
}
}
}