}
private MethodDeclaration createStringGetter(EmitContext context, PropertyDeclaration property) {
assert context != null;
assert property != null;
JavaName name = JavaName.of(property.getName());
name.addFirst("get");
name.addLast("as");
name.addLast("string");
ModelFactory f = context.getModelFactory();
return f.newMethodDeclaration(
new JavadocBuilder(f)
.text("{0}を返す。",
context.getDescription(property))
.returns()
.text("{0}",
context.getDescription(property))
.exception(context.resolve(NullPointerException.class))
.text("{0}の値が<code>null</code>である場合",
context.getDescription(property))
.toJavadoc(),
new AttributeBuilder(f)
.Public()
.toAttributes(),
context.resolve(String.class),
f.newSimpleName(name.toMemberName()),
Collections.<FormalParameterDeclaration>emptyList(),
Collections.singletonList(new ExpressionBuilder(f, f.newThis())
.field(context.getFieldName(property))
.method("getAsString")
.toReturnStatement()));