Example usage for org.eclipse.jdt.core ITypeHierarchy getExtendingInterfaces

List of usage examples for org.eclipse.jdt.core ITypeHierarchy getExtendingInterfaces

Introduction

In this page you can find the example usage for org.eclipse.jdt.core ITypeHierarchy getExtendingInterfaces.

Prototype

IType[] getExtendingInterfaces(IType type);

Source Link

Document

Returns all interfaces resolved to extend the given interface, in no particular order, limited to the interfaces in this hierarchy's graph.

Usage

From source file:edu.brown.cs.bubbles.bedrock.BedrockUtil.java

License:Open Source License

/********************************************************************************/

static void outputTypeHierarchy(ITypeHierarchy th, IvyXmlWriter xw) {
    xw.begin("HIERARCHY");
    IType[] typs = th.getAllTypes();/* w w  w .ja  v a  2  s.c om*/
    for (IType typ : typs) {
        xw.begin("TYPE");
        try {
            xw.field("NAME", typ.getFullyQualifiedName());
            xw.field("QNAME", typ.getTypeQualifiedName());
            xw.field("PNAME", typ.getFullyQualifiedParameterizedName());
            if (typ.isClass())
                xw.field("KIND", "CLASS");
            else if (typ.isEnum())
                xw.field("KIND", "ENUM");
            else if (typ.isInterface())
                xw.field("KIND", "INTERFACE");
            xw.field("LOCAL", typ.isLocal());
            xw.field("MEMBER", typ.isMember());
            xw.field("KEY", typ.getKey());
            IType[] subs = th.getAllSubtypes(typ);
            for (IType styp : subs) {
                xw.begin("SUBTYPE");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("SUBTYPE");
            }
            IType[] sups = th.getAllSuperclasses(typ);
            for (IType styp : sups) {
                xw.begin("SUPERCLASS");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("SUPERCLASS");
            }
            sups = th.getAllSuperInterfaces(typ);
            for (IType styp : sups) {
                xw.begin("SUPERIFACE");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("SUPERIFACE");
            }
            sups = th.getAllSupertypes(typ);
            for (IType styp : sups) {
                xw.begin("SUPERTYPE");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("SUPERTYPE");
            }
            sups = th.getExtendingInterfaces(typ);
            for (IType styp : sups) {
                xw.begin("EXTENDIFACE");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("EXTENDIFACE");
            }
            sups = th.getImplementingClasses(typ);
            for (IType styp : sups) {
                xw.begin("IMPLEMENTOR");
                xw.field("NAME", styp.getFullyQualifiedName());
                xw.field("KEY", styp.getKey());
                xw.end("IMPLEMENTOR");
            }
        } catch (JavaModelException e) {
        }

        xw.end("TYPE");
    }
    xw.end("HIERARCHY");
}