org.eclipse.xtext.xbase.compiler
Class StringBuilderBasedAppendable

java.lang.Object
  extended by org.eclipse.xtext.xbase.compiler.StringBuilderBasedAppendable
All Implemented Interfaces:
IAppendable
Direct Known Subclasses:
FakeTreeAppendable, ReplacingAppendable

@NonNullByDefault
public class StringBuilderBasedAppendable
extends java.lang.Object
implements IAppendable


Constructor Summary
StringBuilderBasedAppendable()
           
StringBuilderBasedAppendable(ImportManager typeSerializer)
           
StringBuilderBasedAppendable(ImportManager typeSerializer, java.lang.String indentation, java.lang.String lineSeparator)
           
 
Method Summary
 IAppendable append(java.lang.CharSequence string)
           
 IAppendable append(JvmType type)
           
protected  void appendType(JvmType type)
           
 char charAt(int index)
           
 void closeScope()
           
 java.lang.String declareSyntheticVariable(java.lang.Object key, java.lang.String proposedName)
          declares a synthetic variable, where the name is not used in the current or any parent scope.
 java.lang.String declareVariable(java.lang.Object key, java.lang.String proposedName)
           
 IAppendable decreaseIndentation()
           
 java.lang.String getContent()
           
protected  ImportManager getImportManager()
           
 java.util.List<java.lang.String> getImports()
           
protected  java.lang.CharSequence getIndentationString()
           
protected  java.lang.String getLineSeparator()
           
 java.lang.String getName(java.lang.Object key)
           
 java.lang.Object getObject(java.lang.String name)
           
 boolean hasName(java.lang.Object key)
           
 boolean hasObject(java.lang.String name)
           
 IAppendable increaseIndentation()
           
 int length()
           
 IAppendable newLine()
           
 void openPseudoScope()
          opens a new variable scope, without having a new Java scope.
 void openScope()
          opens a new scope, backed up by a real Java Scope
 void setScopeStack(ScopeStack scopes)
           
 java.lang.CharSequence subSequence(int start, int end)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringBuilderBasedAppendable

public StringBuilderBasedAppendable(ImportManager typeSerializer,
                                    java.lang.String indentation,
                                    java.lang.String lineSeparator)

StringBuilderBasedAppendable

public StringBuilderBasedAppendable(ImportManager typeSerializer)

StringBuilderBasedAppendable

public StringBuilderBasedAppendable()
Method Detail

append

public IAppendable append(JvmType type)
Specified by:
append in interface IAppendable

append

public IAppendable append(java.lang.CharSequence string)
Specified by:
append in interface IAppendable

newLine

public IAppendable newLine()
Specified by:
newLine in interface IAppendable

getIndentationString

protected java.lang.CharSequence getIndentationString()

toString

public java.lang.String toString()
Specified by:
toString in interface IAppendable
Overrides:
toString in class java.lang.Object

getContent

public java.lang.String getContent()
Specified by:
getContent in interface IAppendable

length

public int length()
Specified by:
length in interface IAppendable

increaseIndentation

public IAppendable increaseIndentation()
Specified by:
increaseIndentation in interface IAppendable

decreaseIndentation

public IAppendable decreaseIndentation()
Specified by:
decreaseIndentation in interface IAppendable

setScopeStack

public void setScopeStack(ScopeStack scopes)

openScope

public void openScope()
Description copied from interface: IAppendable
opens a new scope, backed up by a real Java Scope

Specified by:
openScope in interface IAppendable

openPseudoScope

public void openPseudoScope()
Description copied from interface: IAppendable
opens a new variable scope, without having a new Java scope.

Specified by:
openPseudoScope in interface IAppendable

declareVariable

public java.lang.String declareVariable(java.lang.Object key,
                                        java.lang.String proposedName)
Specified by:
declareVariable in interface IAppendable

declareSyntheticVariable

public java.lang.String declareSyntheticVariable(java.lang.Object key,
                                                 java.lang.String proposedName)
Description copied from interface: IAppendable
declares a synthetic variable, where the name is not used in the current or any parent scope.

Specified by:
declareSyntheticVariable in interface IAppendable

closeScope

public void closeScope()
Specified by:
closeScope in interface IAppendable

appendType

protected void appendType(JvmType type)

getImports

public java.util.List<java.lang.String> getImports()
Specified by:
getImports in interface IAppendable

getImportManager

protected ImportManager getImportManager()

getName

public java.lang.String getName(java.lang.Object key)
Specified by:
getName in interface IAppendable

hasName

public boolean hasName(java.lang.Object key)
Specified by:
hasName in interface IAppendable

getObject

public java.lang.Object getObject(java.lang.String name)
Specified by:
getObject in interface IAppendable

hasObject

public boolean hasObject(java.lang.String name)
Specified by:
hasObject in interface IAppendable

getLineSeparator

protected java.lang.String getLineSeparator()

charAt

public char charAt(int index)

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)