Skip to content

Commit

Permalink
Since Java8 is much more strict on JavaDoc: added generation of @param
Browse files Browse the repository at this point in the history
…for property setter and @returns for propery getter.
  • Loading branch information
diversit committed Jul 14, 2014
1 parent 526d108 commit 6e5ace7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ private boolean isArray(JsonNode node) {
private JMethod addGetter(JDefinedClass c, JFieldVar field, String jsonPropertyName) {
JMethod getter = c.method(JMod.PUBLIC, field.type(), getGetterName(jsonPropertyName, field.type()));

// add @returns
getter.javadoc().addReturn().append("The " + getPropertyName(jsonPropertyName));

JBlock body = getter.body();
body._return(field);

Expand All @@ -154,6 +157,9 @@ private JMethod addGetter(JDefinedClass c, JFieldVar field, String jsonPropertyN
private JMethod addSetter(JDefinedClass c, JFieldVar field, String jsonPropertyName) {
JMethod setter = c.method(JMod.PUBLIC, void.class, getSetterName(jsonPropertyName));

// add @param
setter.javadoc().addParam(getPropertyName(jsonPropertyName)).append("The " + jsonPropertyName);

JVar param = setter.param(field.type(), field.name());
JBlock body = setter.body();
body.assign(JExpr._this().ref(field), param);
Expand Down

0 comments on commit 6e5ace7

Please sign in to comment.