/** * Delegates to {@link #appendTo(TargetStringConcatenation)} to make it publicly accessible. * * @param client * the {@link StringConcatenationClient} on which {@link #appendTo(TargetStringConcatenation)} is * invoked. * @param target * the {@link TargetStringConcatenation} to-append-to. Never <code>null</code>. * @since 2.10 */ public static void appendTo(StringConcatenationClient client, TargetStringConcatenation target) { client.appendTo(target); }
StringConcatenationClient _client = new StringConcatenationClient() { @Override protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { if (constant instanceof Enumerator) { _matched=true; StringConcatenationClient _client = new StringConcatenationClient() { @Override protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { if (constant instanceof String) { _matched=true; StringConcatenationClient _client = new StringConcatenationClient() { @Override protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { StringConcatenationClient _client = new StringConcatenationClient() { @Override protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
/** * Delegates to {@link #appendTo(TargetStringConcatenation)} to make it publicly accessible. * * @param client * the {@link StringConcatenationClient} on which {@link #appendTo(TargetStringConcatenation)} is * invoked. * @param target * the {@link TargetStringConcatenation} to-append-to. Never <code>null</code>. * @since 2.10 */ public static void appendTo(StringConcatenationClient client, TargetStringConcatenation target) { client.appendTo(target); }
/** * Append the contents of a given StringConcatenationClient to this sequence. Does nothing * if the argument is <code>null</code>. * * @param client * the to-be-appended StringConcatenationClient. * @since 2.11 */ public void append(StringConcatenationClient client) { if (client != null) client.appendTo(new SimpleTarget(this, segments.size())); }
/** * Append the contents of a given StringConcatenationClient to this sequence. Does nothing * if that argument is <code>null</code>. The given indentation will be prepended to each line except * the first one. * * @param client * the to-be-appended StringConcatenationClient. * @param indentation * the indentation string that should be prepended. May not be <code>null</code>. * @since 2.11 */ public void append(StringConcatenationClient client, String indentation) { if (indentation.isEmpty()) { append(client); } else if (client != null) client.appendTo(new IndentedTarget(this, indentation, segments.size())); }
protected void append(Object object, int index) { if (object == null) return; if (object instanceof String) { append((String) object, index); } else if (object instanceof StringConcatenation) { StringConcatenation other = (StringConcatenation) object; appendSegments(index, other.getSignificantContent(), other.lineDelimiter); } else if (object instanceof StringConcatenationClient) { StringConcatenationClient other = (StringConcatenationClient) object; other.appendTo(new SimpleTarget(this, index)); } else { final String text = getStringRepresentation(object); if (text != null) { append(text, index); } } }
} else if (object instanceof StringConcatenationClient) { StringConcatenationClient other = (StringConcatenationClient) object; other.appendTo(new IndentedTarget(this, indentation, index)); } else { String value = getStringRepresentation(object);
/** * Add the string representation of the given object to this sequence at the given index. Does nothing if the object * is <code>null</code>. * * @param object * the to-be-appended object. * @param index * the index in the list of segments. */ protected void append(Object object, int index) { if (object == null) return; if (object instanceof StringConcatenation) { StringConcatenation other = (StringConcatenation) object; appendSegments(index, other.getSignificantContent(), other.lineDelimiter); return; } else if (object instanceof StringConcatenationClient) { StringConcatenationClient other = (StringConcatenationClient) object; other.appendTo(new SimpleTarget(this, index)); return; } else { String value = getStringRepresentation(object); List<String> newSegments = splitLinesAndNewLines(value); appendSegments(index, newSegments, lineDelimiter); } }
} else if (object instanceof StringConcatenationClient) { StringConcatenationClient other = (StringConcatenationClient) object; other.appendTo(new IndentedTarget(this, indentation, index)); } else { final String text = getStringRepresentation(object);