Top Description Inners Constructors Methods
org.eclipse.xtend2.lib

public abstract Class StringConcatenationClient

extends Object
Class Inheritance
Annotations
@GwtCompatible
Imports
com.google.common.annotations.GwtCompatible

A callback object that allows to reuse an existing StringConcatenation to append content to it. This puts clients into the position that they can fully control the used instance, e.g. they can use a custom line delimiter or override StringConcatenation#getStringRepresentation(Object).
Author
Sebastian Zarnekow - Initial contribution and API
Since
2.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
StringConcatenationClient.TargetStringConcatenation

A TargetStringConcatenation models the public interface of a StringConcatenation so implementations of the StringConcatenationClient can append their content properly.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
appendTo(StringConcatenationClient.TargetStringConcatenation
the TargetStringConcatenation to-append-to. Never null.
target
)

Implementors have to override this method and feed the given target instance.

public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StringConcatenationClientback to summary
public StringConcatenationClient()

Method Detail

appendToback to summary
protected void appendTo(StringConcatenationClient.TargetStringConcatenation target)

Implementors have to override this method and feed the given target instance.

Parameters
target:StringConcatenationClient.TargetStringConcatenation

the TargetStringConcatenation to-append-to. Never null.

appendToback to summary
public static void appendTo(StringConcatenationClient client, StringConcatenationClient.TargetStringConcatenation target)

Delegates to appendTo(TargetStringConcatenation) to make it publicly accessible.

Parameters
client:StringConcatenationClient

the StringConcatenationClient on which appendTo(TargetStringConcatenation) is invoked.

target:StringConcatenationClient.TargetStringConcatenation

the TargetStringConcatenation to-append-to. Never null.

Since
2.10
org.eclipse.xtend2.lib back to summary

public Interface StringConcatenationClient.TargetStringConcatenation

extends CharSequence
Known Direct Implementers
org.eclipse.xtend2.lib.StringConcatenation.SimpleTarget

A TargetStringConcatenation models the public interface of a StringConcatenation so implementations of the StringConcatenationClient can append their content properly.
Since
2.5

Method Summary

Modifier and TypeMethod and Description
public void
append(Object
the appended object.
object
,
String
the indentation string that should be prepended. May not be null.
indentation
)

Add the string representation of the given object to this sequence.

public void
append(Object
the to-be-appended object.
object
)

Append the string representation of the given object to this sequence.

public void
appendImmediate(Object
the to-be-appended object.
object
,
String
the indentation string that should be prepended. May not be null.
indentation
)

Add the string representation of the given object to this sequence immediately.

public void
newLine()

Add a newline to this sequence according to the configured lineDelimiter.

public void
newLineIfNotEmpty()

Add a newline to this sequence according to the configured lineDelimiter if the last line contains something besides whitespace.

Inherited from java.lang.CharSequence:
charAtcharscodePointscompareisEmptylengthsubSequencetoString

Method Detail

appendback to summary
public void append(Object object, String indentation)

Add the string representation of the given object to this sequence. The given indentation will be prepended to each line except the first one if the object has a multi-line string representation.

Parameters
object:Object

the appended object.

indentation:String

the indentation string that should be prepended. May not be null.

appendback to summary
public void append(Object object)

Append the string representation of the given object to this sequence. Does nothing if the object is null.

Parameters
object:Object

the to-be-appended object.

appendImmediateback to summary
public void appendImmediate(Object object, String indentation)

Add the string representation of the given object to this sequence immediately. That is, all the trailing whitespace of this sequence will be ignored and the string is appended directly after the last segment that contains something besides whitespace. The given indentation will be prepended to each line except the first one if the object has a multi-line string representation.

Parameters
object:Object

the to-be-appended object.

indentation:String

the indentation string that should be prepended. May not be null.

newLineback to summary
public void newLine()

Add a newline to this sequence according to the configured lineDelimiter.

newLineIfNotEmptyback to summary
public void newLineIfNotEmpty()

Add a newline to this sequence according to the configured lineDelimiter if the last line contains something besides whitespace.