List of usage examples for org.eclipse.jdt.internal.core Openable getParent
@Override
public IJavaElement getParent()
From source file:org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.java
License:Open Source License
/** * Create a type info from the given class file in a jar and adds it to the given list of infos. *///from ww w .j a va 2 s . c o m protected IBinaryType createInfoFromClassFileInJar(Openable classFile) { PackageFragment pkg = (PackageFragment) classFile.getParent(); String classFilePath = Util.concatWith(pkg.names, classFile.getElementName(), '/'); IBinaryType info = null; java.util.zip.ZipFile zipFile = null; try { zipFile = ((JarPackageFragmentRoot) pkg.getParent()).getJar(); info = org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(zipFile, classFilePath); } catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException e) { if (TypeHierarchy.DEBUG) { e.printStackTrace(); } return null; } catch (java.io.IOException e) { if (TypeHierarchy.DEBUG) { e.printStackTrace(); } return null; } catch (CoreException e) { if (TypeHierarchy.DEBUG) { e.printStackTrace(); } return null; } finally { JavaModelManager.getJavaModelManager().closeZipFile(zipFile); } this.infoToHandle.put(info, classFile); return info; }