builder.privateField(name, type)
.initializesWith(Stmt.newObject(implementation)).finish();
}
public static StringBuilderBuilder newStringBuilder() {
final ContextualStatementBuilder statementBuilder
= Stmt.nestedCall(Stmt.newObject(StringBuilder.class));
return new StringBuilderBuilder() {
@Override
public StringBuilderBuilder append(Object statement) {
statementBuilder.invoke("append", statement);
return this;
}
@Override
public String generate(Context context) {
return statementBuilder.generate(context);
}
@Override
public MetaClass getType() {
return statementBuilder.getType();
}
};
}