ImportBuilder importer,
List<? extends Expression> arguments) throws IOException {
assert className != null;
assert importer != null;
assert arguments != null;
ModelFactory f = environment.getModelFactory();
Statement ctorChain = f.newSuperConstructorInvocation(arguments);
ConstructorDeclaration ctorDecl = f.newConstructorDeclaration(
new JavadocBuilder(f)
.text("Creates a new instance.")
.toJavadoc(),
new AttributeBuilder(f)
.Public()
.toAttributes(),
className,
Collections.<FormalParameterDeclaration>emptyList(),
Collections.singletonList(ctorChain));
ClassDeclaration typeDecl = f.newClassDeclaration(
new JavadocBuilder(f)
.toJavadoc(),
new AttributeBuilder(f)
.annotation(importer.toType(TraceLocation.class), createTraceLocationElements())
.Public()
.Final()
.toAttributes(),
className,
importer.resolve(baseClass),
Collections.<Type>emptyList(),
Collections.singletonList(ctorDecl));
CompilationUnit source = f.newCompilationUnit(
importer.getPackageDeclaration(),
importer.toImportDeclarations(),
Collections.singletonList(typeDecl),
Collections.<Comment>emptyList());
environment.emit(source);