@Command("list-imports") @RequiresResource(JavaResource.class) public void listImports(final PipeOut out) throws FileNotFoundException { List<Import> imports = resource.getJavaSource().getImports(); for (Import i : imports) { String str = "import " + (i.isStatic() ? "static " : "") + i.getQualifiedName() + ";"; str = JavaColorizer.format(out, str); out.println(str); } }
@Override public Import addImport(final Import imprt) { return addImport(imprt.getQualifiedName()).setStatic(imprt.isStatic()); }