Example usage for org.eclipse.jdt.internal.core ClassFile translatedName

List of usage examples for org.eclipse.jdt.internal.core ClassFile translatedName

Introduction

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

Prototype


public static char[] translatedName(char[] name) 

Source Link

Document

Returns the Java Model representation of the given name which is provided in diet class file format, or null if the given name is null.

Usage

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

License:Open Source License

/**
 * Looks up and returns a handle for the given binary info.
 *//*from  w ww.  j  a  v a2  s. c om*/
protected IType lookupBinaryHandle(IBinaryType typeInfo) {
    int flag;
    String qualifiedName;
    switch (TypeDeclaration.kind(typeInfo.getModifiers())) {
    case TypeDeclaration.CLASS_DECL:
        flag = NameLookup.ACCEPT_CLASSES;
        break;
    case TypeDeclaration.INTERFACE_DECL:
        flag = NameLookup.ACCEPT_INTERFACES;
        break;
    case TypeDeclaration.ENUM_DECL:
        flag = NameLookup.ACCEPT_ENUMS;
        break;
    default:
        //case IGenericType.ANNOTATION :
        flag = NameLookup.ACCEPT_ANNOTATIONS;
        break;
    }
    char[] bName = typeInfo.getName();
    qualifiedName = new String(ClassFile.translatedName(bName));
    if (qualifiedName.equals(this.focusQualifiedName))
        return getType();
    NameLookup.Answer answer = this.nameLookup.findType(qualifiedName, false, flag,
            true/* consider secondary types */, false/* do NOT wait for indexes */,
            false/*don't check restrictions*/, null);
    return answer == null || answer.type == null || !answer.type.isBinary() ? null : answer.type;

}