示例#1
0
 @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);
   }
 }
示例#2
0
 @Override
 public Import addImport(final Import imprt) {
   return addImport(imprt.getQualifiedName()).setStatic(imprt.isStatic());
 }