Example usage for org.aspectj.apache.bcel.classfile JavaClass getInterfaceNames

List of usage examples for org.aspectj.apache.bcel.classfile JavaClass getInterfaceNames

Introduction

In this page you can find the example usage for org.aspectj.apache.bcel.classfile JavaClass getInterfaceNames.

Prototype

public String[] getInterfaceNames() 

Source Link

Usage

From source file:br.jabuti.lookup.java.bytecode.RClassCode.java

License:Open Source License

/** Creates a RClassCode given its name and a {@link JavaClass}
 object /*ww w  .  j av a 2 s.  c o  m*/
        
 @param y The {@link JavaClass} object already created for this class
 @param x The complete name of the class
 */
public RClassCode(JavaClass y, String x) {
    super(x);
    theClass = null;
    theClassPersistent = Persistency.add(y.getBytes());
    if (theClassPersistent == null)
        theClass = y;
    superName = y.getSuperclassName();
    interfaces = y.getInterfaceNames();
    isInter = y.isInterface();
}

From source file:br.jabuti.metrics.klass.MetricNII.java

License:Open Source License

@Override
public double getResult(Program prog, String className) {
    RClass rc = prog.get(className);//from   ww  w .  jav  a  2  s  .com
    if (!(rc instanceof RClassCode)) {
        return -1.0;
    }
    RClassCode rcc = (RClassCode) rc;
    JavaClass theClazz = rcc.getTheClass();
    String[] dummy = theClazz.getInterfaceNames();
    if (dummy == null) {
        return 0.0;
    }
    return (double) dummy.length;
}