assert context != null;
assert descriptor != null;
assert parameters != null;
List<Statement> statements = Lists.create();
SimpleName builderName = context.names.create("builder");
statements.add(new TypeBuilder(factory, util.t(OperatorDescription.Builder.class))
.newObject(factory.newClassLiteral(util.t(descriptor.getAnnotationType())))
.toLocalVariableDeclaration(
util.t(OperatorDescription.Builder.class),
builderName));
statements.add(new ExpressionBuilder(factory, builderName)
.method("declare",
factory.newClassLiteral(util.t(operatorClass.getElement())),
factory.newClassLiteral(factory.newNamedType(
util.getImplementorName(operatorClass.getElement()))),
util.v(descriptor.getName()))
.toStatement());
for (VariableElement parameter : context.element.getParameters()) {
statements.add(new ExpressionBuilder(factory, builderName)
.method("declareParameter",
new TypeBuilder(factory, util.t(environment.getErasure(parameter.asType())))
.dotClass()
.toExpression())
.toStatement());
}