Example usage for org.eclipse.jdt.internal.core BinaryType getDeclaringType

List of usage examples for org.eclipse.jdt.internal.core BinaryType getDeclaringType

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core BinaryType getDeclaringType.

Prototype

@Override
    public IType getDeclaringType() 

Source Link

Usage

From source file:org.sf.feeling.decompiler.editor.DecompilerSourceMapper.java

License:Open Source License

public char[] findSource(IType type) throws JavaModelException {
    if (!type.isBinary()) {
        return null;
    }//from  w w w . ja va2 s  .co m
    BinaryType parent = (BinaryType) type.getDeclaringType();
    BinaryType declType = (BinaryType) type;
    while (parent != null) {
        declType = parent;
        parent = (BinaryType) declType.getDeclaringType();
    }
    IBinaryType info = null;

    info = (IBinaryType) declType.getElementInfo();

    if (info == null) {
        return null;
    }
    return findSource(type, info);
}