Example usage for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding getMemberType

List of usage examples for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding getMemberType

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding getMemberType.

Prototype

public ReferenceBinding getMemberType(char[] typeName) 

Source Link

Document

Find the member type with the given simple typeName.

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.copyinheritance.CopyInheritance.java

License:Open Source License

/**
 * If a requested member type was not found in a team binding try if a combination
 * of role file loading and role copying resolves the issue.
 *///from  w w w .  jav a  2  s . co m
public static ReferenceBinding checkCopyLateRoleFile(SourceTypeBinding teamBinding, char[] name) {
    if (!TeamModel.hasTagBit(teamBinding, TeamModel.BeginCopyRoles))
        return null;
    ReferenceBinding ifcPart = null;
    if (CharOperation.prefixEquals(IOTConstants.OT_DELIM_NAME, name)) {
        char[] ifcName = CharOperation.subarray(name, IOTConstants.OT_DELIM_LEN, -1);
        ifcPart = teamBinding.getMemberType(ifcName);
    }
    TypeDeclaration roleDecl = internalCheckCopyLateRoleFile(teamBinding, name);
    if (roleDecl != null && ifcPart != null) {
        ReferenceBinding superTeam = teamBinding.superclass;
        if (!hasHiearchyCheckBegun(superTeam))
            Dependencies.ensureBindingState(superTeam, ITranslationStates.STATE_LENV_CONNECT_TYPE_HIERARCHY);
        TypeLevel.connectRoleClasses(superTeam, roleDecl);
    }
    if (roleDecl != null)
        return roleDecl.binding;
    return null;
}