org.eclipse.xtext.xtend2.lib
Class StringConcatenation

java.lang.Object
  extended by org.eclipse.xtend2.lib.StringConcatenation
      extended by org.eclipse.xtext.xtend2.lib.StringConcatenation
All Implemented Interfaces:
java.lang.CharSequence

Deprecated. use org.eclipse.xtend2.lib.StringConcatenation from bundle org.eclipse.xtend2.lib

@Deprecated
public class StringConcatenation
extends StringConcatenation

A StringConcatenation allows for efficient, indentation aware concatenation of character sequences.

In addition to the methods that are specified by the implemented interface CharSequence, there are some other public operations that allow to modify the contents of this sequence. The string representation of arbitrary objects can be appended to an instance of StringConcatenation. There are overloaded variants of StringConcatenation.append(Object, String) that allow to pass an indentation that should be applied to each line of the appended content. Each line break that is part of the new content will be replaced by the line delimiter that was configured for this StringConcatenation.

The append-operation ignores null arguments. This is different to what StringBuffer or StringBuilder do and that's the reason why the Appendable interface is not fulfilled by a StringConcatenation.

The object uses an internal List of Strings that is concatenated on demand to a complete sequence. Use StringConcatenation.toString() to get the joined version of a StringConcatenation.

Object.equals(Object) and Object.hashCode() are not specialized for a StringConcatenation, that is, the semantics are based on identity similar to what StringBuffer and StringBuilder do.

Author:
Sebastian Zarnekow - Initial contribution and API

Field Summary
static java.lang.String DEFAULT_LINE_DELIMITER
          Deprecated. The default line delimiter that is used by instances of StringConcatenation.
 
Constructor Summary
StringConcatenation()
          Deprecated. Create a new concatenation that uses the system line delimiter.
StringConcatenation(java.lang.String lineDelimiter)
          Deprecated. Create a new concatenation with the specified delimiter.
 
Method Summary
 
Methods inherited from class org.eclipse.xtend2.lib.StringConcatenation
append, append, append, append, appendImmediate, appendSegments, charAt, getSignificantContent, length, newLine, newLineIfNotEmpty, splitLinesAndNewLines, subSequence, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LINE_DELIMITER

public static final java.lang.String DEFAULT_LINE_DELIMITER
Deprecated. 
The default line delimiter that is used by instances of StringConcatenation. It uses System.getProperty("line.separator").

Since:
2.2
Constructor Detail

StringConcatenation

public StringConcatenation()
Deprecated. 
Create a new concatenation that uses the system line delimiter.

See Also:
System.getProperties(), System.getProperty(String)

StringConcatenation

public StringConcatenation(java.lang.String lineDelimiter)
Deprecated. 
Create a new concatenation with the specified delimiter.

Parameters:
lineDelimiter - the used delimiter.
Throws:
java.lang.IllegalArgumentException - if the lineDelimiter is null or the empty String.
Since:
2.2