}
private MethodDeclaration createStringSetter(EmitContext context, PropertyDeclaration property) {
assert context != null;
assert property != null;
JavaName name = JavaName.of(property.getName());
name.addFirst("set");
name.addLast("as");
name.addLast("string");
ModelFactory f = context.getModelFactory();
SimpleName paramName = context.createVariableName(
context.getFieldName(property).getToken());
return f.newMethodDeclaration(
new JavadocBuilder(f)
.text("{0}を設定する。",
context.getDescription(property))
.param(paramName)
.text("設定する値",
context.getDescription(property))
.toJavadoc(),
new AttributeBuilder(f)
.annotation(
context.resolve(SuppressWarnings.class),
Models.toLiteral(f, "deprecation"))
.Public()
.toAttributes(),
context.resolve(void.class),
f.newSimpleName(name.toMemberName()),
Arrays.asList(new FormalParameterDeclaration[] {
f.newFormalParameterDeclaration(
context.resolve(String.class),
paramName)
}),