Package org.eclipse.xtext.xbase.compiler
Class AbstractStringBuilderBasedAppendable
- java.lang.Object
-
- org.eclipse.xtext.xbase.compiler.AbstractStringBuilderBasedAppendable
-
- All Implemented Interfaces:
IAppendable,ISourceAppender
- Direct Known Subclasses:
StringBuilderBasedAppendable
public abstract class AbstractStringBuilderBasedAppendable extends java.lang.Object implements IAppendable
-
-
Constructor Summary
Constructors Constructor Description AbstractStringBuilderBasedAppendable(boolean isJava)AbstractStringBuilderBasedAppendable(java.lang.String indentation, java.lang.String lineSeparator, boolean isJava)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IAppendableappend(java.lang.CharSequence string)IAppendableappend(java.lang.Class<?> type)IAppendableappend(org.eclipse.xtext.common.types.JvmType type)IAppendableappend(LightweightTypeReference typeRef)protected abstract voidappendType(java.lang.Class<?> type, java.lang.StringBuilder builder)protected abstract voidappendType(org.eclipse.xtext.common.types.JvmType type, java.lang.StringBuilder builder)charcharAt(int index)voidcloseScope()protected LightweightTypeReferenceSerializercreateLightweightTypeReferenceSerializer()java.lang.StringdeclareSyntheticVariable(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 except by other synthetic variables.java.lang.StringdeclareUniqueNameVariable(java.lang.Object key, java.lang.String proposedName)Declares a variable with unique name, which is not used in the current or any parent scope.java.lang.StringdeclareVariable(java.lang.Object key, java.lang.String proposedName)IAppendabledecreaseIndentation()java.lang.StringgetContent()GeneratorConfiggetGeneratorConfig()abstract java.util.List<java.lang.String>getImports()Deprecated.protected intgetIndentationLevel()protected java.lang.CharSequencegetIndentationString()protected java.lang.StringgetLineSeparator()java.lang.StringgetName(java.lang.Object key)java.lang.ObjectgetObject(java.lang.String name)booleanhasName(java.lang.Object key)booleanhasObject(java.lang.String name)IAppendableincreaseIndentation()booleanisJava()intlength()IAppendablenewLine()voidopenPseudoScope()opens a new variable scope, without having a new Java scope.voidopenScope()opens a new scope, backed up by a real Java Scopejava.lang.StringremoveName(java.lang.Object key)voidsetGeneratorConfig(GeneratorConfig config)voidsetScopeStack(ScopeStack scopes)java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()
-
-
-
Method Detail
-
isJava
public boolean isJava()
- Specified by:
isJavain interfaceISourceAppender
-
append
public IAppendable append(org.eclipse.xtext.common.types.JvmType type)
- Specified by:
appendin interfaceIAppendable- Specified by:
appendin interfaceISourceAppender
-
append
public IAppendable append(java.lang.Class<?> type)
-
append
public IAppendable append(LightweightTypeReference typeRef)
- Specified by:
appendin interfaceIAppendable- Specified by:
appendin interfaceISourceAppender
-
createLightweightTypeReferenceSerializer
protected LightweightTypeReferenceSerializer createLightweightTypeReferenceSerializer()
-
append
public IAppendable append(java.lang.CharSequence string)
- Specified by:
appendin interfaceIAppendable- Specified by:
appendin interfaceISourceAppender
-
newLine
public IAppendable newLine()
- Specified by:
newLinein interfaceIAppendable- Specified by:
newLinein interfaceISourceAppender
-
getIndentationString
protected java.lang.CharSequence getIndentationString()
-
getIndentationLevel
protected int getIndentationLevel()
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceIAppendable- Overrides:
toStringin classjava.lang.Object
-
getContent
public java.lang.String getContent()
- Specified by:
getContentin interfaceIAppendable
-
length
public int length()
- Specified by:
lengthin interfaceIAppendable
-
increaseIndentation
public IAppendable increaseIndentation()
- Specified by:
increaseIndentationin interfaceIAppendable- Specified by:
increaseIndentationin interfaceISourceAppender
-
decreaseIndentation
public IAppendable decreaseIndentation()
- Specified by:
decreaseIndentationin interfaceIAppendable- Specified by:
decreaseIndentationin interfaceISourceAppender
-
setScopeStack
public void setScopeStack(ScopeStack scopes)
-
openScope
public void openScope()
Description copied from interface:IAppendableopens a new scope, backed up by a real Java Scope- Specified by:
openScopein interfaceIAppendable
-
openPseudoScope
public void openPseudoScope()
Description copied from interface:IAppendableopens a new variable scope, without having a new Java scope.- Specified by:
openPseudoScopein interfaceIAppendable
-
declareVariable
public java.lang.String declareVariable(java.lang.Object key, java.lang.String proposedName)- Specified by:
declareVariablein interfaceIAppendable
-
declareSyntheticVariable
public java.lang.String declareSyntheticVariable(java.lang.Object key, java.lang.String proposedName)Description copied from interface:IAppendableDeclares a synthetic variable, where the name is not used in the current or any parent scope except by other synthetic variables.- Specified by:
declareSyntheticVariablein interfaceIAppendable
-
declareUniqueNameVariable
public java.lang.String declareUniqueNameVariable(java.lang.Object key, java.lang.String proposedName)Description copied from interface:IAppendableDeclares a variable with unique name, which is not used in the current or any parent scope. This is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=445949- Specified by:
declareUniqueNameVariablein interfaceIAppendable
-
closeScope
public void closeScope()
- Specified by:
closeScopein interfaceIAppendable
-
removeName
public java.lang.String removeName(java.lang.Object key)
- Specified by:
removeNamein interfaceIAppendable
-
appendType
protected abstract void appendType(org.eclipse.xtext.common.types.JvmType type, java.lang.StringBuilder builder)
-
appendType
protected abstract void appendType(java.lang.Class<?> type, java.lang.StringBuilder builder)
-
getImports
@Deprecated public abstract java.util.List<java.lang.String> getImports()
Deprecated.- Specified by:
getImportsin interfaceIAppendable
-
getName
public java.lang.String getName(java.lang.Object key)
- Specified by:
getNamein interfaceIAppendable
-
hasName
public boolean hasName(java.lang.Object key)
- Specified by:
hasNamein interfaceIAppendable
-
getObject
public java.lang.Object getObject(java.lang.String name)
- Specified by:
getObjectin interfaceIAppendable
-
hasObject
public boolean hasObject(java.lang.String name)
- Specified by:
hasObjectin interfaceIAppendable
-
getLineSeparator
protected java.lang.String getLineSeparator()
-
charAt
public char charAt(int index)
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)
-
getGeneratorConfig
public GeneratorConfig getGeneratorConfig()
- Specified by:
getGeneratorConfigin interfaceIAppendable
-
setGeneratorConfig
public void setGeneratorConfig(GeneratorConfig config)
-
-