List of usage examples for org.eclipse.jdt.internal.core ClassFile getTypeName
public String getTypeName()
From source file:org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.java
License:Open Source License
/** * Returns a handle for the given generic type or null if not found. *//*w w w.j a v a2s .com*/ protected IType getHandle(IGenericType genericType, ReferenceBinding binding) { if (genericType == null) return null; if (genericType instanceof HierarchyType) { IType handle = (IType) this.infoToHandle.get(genericType); if (handle == null) { handle = ((HierarchyType) genericType).typeHandle; handle = (IType) ((JavaElement) handle).resolved(binding); this.infoToHandle.put(genericType, handle); } return handle; } else if (genericType.isBinaryType()) { ClassFile classFile = (ClassFile) this.infoToHandle.get(genericType); // if it's null, it's from outside the region, so do lookup if (classFile == null) { IType handle = lookupBinaryHandle((IBinaryType) genericType); if (handle == null) return null; // case of an anonymous type (see 1G2O5WK: ITPJCORE:WINNT - NullPointerException when selecting "Show in Type Hierarchy" for a inner class) // optimization: remember the handle for next call (case of java.io.Serializable that a lot of classes implement) classFile = (ClassFile) handle.getParent(); this.infoToHandle.put(genericType, classFile); } return new ResolvedBinaryType(classFile, classFile.getTypeName(), new String(binding.computeUniqueKey())); } else if (genericType instanceof SourceTypeElementInfo) { IType handle = ((SourceTypeElementInfo) genericType).getHandle(); return (IType) ((JavaElement) handle).resolved(binding); } else return null; }