diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java index c0e7874221..10bee0fea8 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java @@ -633,11 +633,13 @@ private CharSequence generateGroupEncoderProperty(final String groupName, final sb.append(String.format( "\n" + - indent + " public %1$s %2$sCount(final int count)\n" + + "%1$s" + + indent + " public %2$s %3$sCount(final int count)\n" + indent + " {\n" + - indent + " %2$s.wrap(parentMessage, buffer, count);\n" + - indent + " return %2$s;\n" + + indent + " %3$s.wrap(parentMessage, buffer, count);\n" + + indent + " return %3$s;\n" + indent + " }\n", + generateGroupEncodePropertyJavadoc(indent + INDENT, token, className), className, propertyName)); diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java index 66d6a54869..7d866b51ab 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java @@ -318,7 +318,7 @@ public static String generateOptionEncodeJavadoc(final String indent, final Toke } /** - * Generate the Javadoc comment header for a bitset choice option decode method. + * Generate the Javadoc comment header for flyweight property. * * @param indent level for the comment. * @param propertyToken for the property name. @@ -341,4 +341,30 @@ public static String generateFlyweightPropertyJavadoc( indent + " * @return " + typeName + " : " + description + "\n" + indent + " */\n"; } + + /** + * Generate the Javadoc comment header for group encode property. + * + * @param indent level for the comment. + * @param propertyToken for the property name. + * @param typeName for the property type. + * @return a string representation of the Javadoc comment. + */ + public static String generateGroupEncodePropertyJavadoc( + final String indent, final Token propertyToken, final String typeName) + { + final String description = propertyToken.description(); + if (null == description || description.isEmpty()) + { + return ""; + } + + return + indent + "/**\n" + + indent + " * " + description + "\n" + + indent + " *\n" + + indent + " * @param count of times the group will be encoded\n" + + indent + " * @return " + typeName + " : encoder for the group\n" + + indent + " */\n"; + } }