/** * Override in subclasses in order to inject custom content into Json just before the closing brace. * * <p>To keep the formatting, it is recommended to implement this method as the example below. * * <blockquote><pre> * sb.append(','); * if (pretty) { sb.append('\n').append(indent); } * sb.append("\"test\":\"...\""); * </pre></blockquote> * * @param sb to write custom content to * @param pretty pretty format (human readable), or one line text. * @param indent indent at current level * @param attributeNames list of attributes to include */ public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) { StringWriter writer = new StringWriter(); beforeClosingBrace(pretty, indent, writer); sb.append(writer.toString()); }
beforeClosingBrace(sb, pretty, pretty ? " " + indent : "", attributeNames); if (pretty) { sb.append('\n').append(indent); } sb.append('}');
/** * Override in subclasses in order to inject custom content into Json just before the closing brace. * * <p>To keep the formatting, it is recommended to implement this method as the example below. * * <blockquote><pre> * sb.append(','); * if (pretty) { sb.append('\n').append(indent); } * sb.append("\"test\":\"...\""); * </pre></blockquote> * * @param sb to write custom content to * @param pretty pretty format (human readable), or one line text. * @param indent indent at current level * @param attributeNames list of attributes to include */ public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) { StringWriter writer = new StringWriter(); beforeClosingBrace(pretty, indent, writer); sb.append(writer.toString()); }
/** * Override in subclasses in order to inject custom content into Json just before the closing brace. * * <p>To keep the formatting, it is recommended to implement this method as the example below. * * <blockquote><pre> * sb.append(','); * if (pretty) { sb.append('\n').append(indent); } * sb.append("\"test\":\"...\""); * </pre></blockquote> * * @param sb to write custom content to * @param pretty pretty format (human readable), or one line text. * @param indent indent at current level * @param attributeNames list of attributes to include */ public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) { StringWriter writer = new StringWriter(); beforeClosingBrace(pretty, indent, writer); sb.append(writer.toString()); }
beforeClosingBrace(sb, pretty, pretty ? " " + indent : "", attributeNames); if (pretty) { sb.append('\n').append(indent); } sb.append('}');
beforeClosingBrace(sb, pretty, pretty ? " " + indent : "", attributeNames); if (pretty) { sb.append('\n').append(indent); } sb.append('}');