Example usage for org.eclipse.jdt.internal.core.util HandleFactory createElement

List of usage examples for org.eclipse.jdt.internal.core.util HandleFactory createElement

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util HandleFactory createElement.

Prototype

public IJavaElement createElement(ClassScope scope, ICompilationUnit unit, HashSet existingElements,
        HashMap knownScopes) 

Source Link

Document

Returns a handle denoting the class member identified by its scope.

Usage

From source file:org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.java

License:Open Source License

private void rememberAllTypes(CompilationUnitDeclaration parsedUnit, org.eclipse.jdt.core.ICompilationUnit cu,
        boolean includeLocalTypes) {
    TypeDeclaration[] types = parsedUnit.types;
    if (types != null) {
        for (int i = 0, length = types.length; i < length; i++) {
            TypeDeclaration type = types[i];
            rememberWithMemberTypes(type, cu.getType(new String(type.name)));
        }/*from   w w  w.ja  v  a  2 s  .  c  om*/
    }
    if (includeLocalTypes && parsedUnit.localTypes != null) {
        HandleFactory factory = new HandleFactory();
        HashSet existingElements = new HashSet(parsedUnit.localTypeCount);
        HashMap knownScopes = new HashMap(parsedUnit.localTypeCount);
        for (int i = 0; i < parsedUnit.localTypeCount; i++) {
            LocalTypeBinding localType = parsedUnit.localTypes[i];
            ClassScope classScope = localType.scope;
            TypeDeclaration typeDecl = classScope.referenceType();
            IType typeHandle = (IType) factory.createElement(classScope, cu, existingElements, knownScopes);
            rememberWithMemberTypes(typeDecl, typeHandle);
        }
    }
}