Example usage for org.eclipse.jdt.core.util IClassFileReader isClass

List of usage examples for org.eclipse.jdt.core.util IClassFileReader isClass

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.util IClassFileReader isClass.

Prototype

boolean isClass();

Source Link

Document

Answer true if this .class file represents a class, false otherwise.

Usage

From source file:net.rim.ejde.internal.packaging.PackagingManager.java

License:Open Source License

/**
 * Verify if the given <code>classFileReader</code> has code attributes.
 *
 * @param classFileReader//from w w  w .  ja v  a 2  s  .  co m
 * @return
 */
static private boolean isEvisceratedClass(IClassFileReader classFileReader) {
    // ignore interface classes
    if (!classFileReader.isClass()) {
        return false;
    }
    IMethodInfo[] methodInfos = classFileReader.getMethodInfos();
    if (methodInfos == null) {
        return false;
    }
    for (int i = 0; i < methodInfos.length; i++) {
        // Ignore <init>, <clinit> and abstract methods
        if ("<init>".equalsIgnoreCase(String.valueOf(methodInfos[i].getName())) || methodInfos[i].isClinit()
                || (methodInfos[i].getAccessFlags() & IModifierConstants.ACC_ABSTRACT) != 0) {
            continue;
        }
        if (methodInfos[i].getCodeAttribute() == null) {
            return true;
        }
    }
    return false;
}