@Override public JavaWriter suppressWarnings(String type) throws IOException { return line("@SuppressWarnings(\"", type, "\")"); }
@Override public JavaWriter staticimports(Class<?>... imports) throws IOException { for (Class<?> cl : imports) { line(IMPORT_STATIC, cl.getName(), ".*;"); } return this; }
@Override public JavaWriter packageDecl(String packageName) throws IOException { packages.add(packageName); return line(PACKAGE, packageName, SEMICOLON).nl(); }
@Override public JavaWriter imports(Class<?>... imports) throws IOException { for (Class<?> cl : imports) { classes.add(cl.getName()); line(IMPORT, cl.getName(), SEMICOLON); } nl(); return this; }
@Override public JavaWriter importClasses(String... imports) throws IOException { for (String cl : imports) { classes.add(cl); line(IMPORT, cl, SEMICOLON); } nl(); return this; }
@Override public JavaWriter imports(Package... imports) throws IOException { for (Package p : imports) { packages.add(p.getName()); line(IMPORT, p.getName(), ".*;"); } nl(); return this; }
@Override public JavaWriter importPackages(String... imports) throws IOException { for (String p : imports) { packages.add(p); line(IMPORT, p, ".*;"); } nl(); return this; }
@Override public JavaWriter end() throws IOException { types.pop(); goOut(); return line("}").nl(); }
@Override public JavaWriter field(Type type, String name) throws IOException { return line(type.getGenericName(true, packages, classes), SPACE, name, SEMICOLON).nl(); }
private JavaWriter field(String modifier, Type type, String name) throws IOException { return line( modifier, type.getGenericName(true, packages, classes), SPACE, name, SEMICOLON) .nl(); }
private JavaWriter field(String modifier, Type type, String name, String value) throws IOException { return line( modifier, type.getGenericName(true, packages, classes), SPACE, name, ASSIGN , value, SEMICOLON).nl(); }