use of com.strobel.decompiler.languages.java.ast.CompilationUnit in project j2objc by google.
the class ClassFile method create.
public static ClassFile create(InputFile file) throws IOException {
ITypeLoader loader;
String path = file.getAbsolutePath();
if (path.endsWith(".jar")) {
loader = new JarTypeLoader(new JarFile(path));
path = file.getUnitName();
if (!path.endsWith(".class")) {
return null;
}
// Remove .class suffix, as JarTypeLoader adds it.
path = path.substring(0, path.length() - 6);
} else {
loader = new InputTypeLoader();
}
TypeReference typeRef = lookupType(path, loader);
CompilationUnit unit = decompileClassFile(typeRef);
return new ClassFile(unit, typeRef);
}
Aggregations