public abstract class AbstractStringBuilderBasedAppendable extends java.lang.Object implements IAppendable
Constructor and Description |
---|
AbstractStringBuilderBasedAppendable(boolean isJava) |
AbstractStringBuilderBasedAppendable(java.lang.String indentation,
java.lang.String lineSeparator,
boolean isJava) |
Modifier and Type | Method and Description |
---|---|
IAppendable |
append(java.lang.CharSequence string) |
IAppendable |
append(java.lang.Class<?> type) |
IAppendable |
append(JvmType type) |
IAppendable |
append(LightweightTypeReference typeRef) |
protected abstract void |
appendType(java.lang.Class<?> type,
java.lang.StringBuilder builder) |
protected abstract void |
appendType(JvmType type,
java.lang.StringBuilder builder) |
char |
charAt(int index) |
void |
closeScope() |
protected LightweightTypeReferenceSerializer |
createLightweightTypeReferenceSerializer() |
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
except by other synthetic variables.
|
java.lang.String |
declareUniqueNameVariable(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.String |
declareVariable(java.lang.Object key,
java.lang.String proposedName) |
IAppendable |
decreaseIndentation() |
java.lang.String |
getContent() |
GeneratorConfig |
getGeneratorConfig() |
abstract java.util.List<java.lang.String> |
getImports()
Deprecated.
|
protected int |
getIndentationLevel() |
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() |
boolean |
isJava() |
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
|
java.lang.String |
removeName(java.lang.Object key) |
void |
setGeneratorConfig(GeneratorConfig config) |
void |
setScopeStack(ScopeStack scopes) |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
public AbstractStringBuilderBasedAppendable(java.lang.String indentation, java.lang.String lineSeparator, boolean isJava)
public AbstractStringBuilderBasedAppendable(boolean isJava)
public boolean isJava()
isJava
in interface ISourceAppender
public IAppendable append(JvmType type)
append
in interface IAppendable
append
in interface ISourceAppender
public IAppendable append(java.lang.Class<?> type)
public IAppendable append(LightweightTypeReference typeRef)
append
in interface IAppendable
append
in interface ISourceAppender
protected LightweightTypeReferenceSerializer createLightweightTypeReferenceSerializer()
public IAppendable append(java.lang.CharSequence string)
append
in interface IAppendable
append
in interface ISourceAppender
public IAppendable newLine()
newLine
in interface IAppendable
newLine
in interface ISourceAppender
protected java.lang.CharSequence getIndentationString()
protected int getIndentationLevel()
public java.lang.String toString()
toString
in interface IAppendable
toString
in class java.lang.Object
public java.lang.String getContent()
getContent
in interface IAppendable
public int length()
length
in interface IAppendable
public IAppendable increaseIndentation()
increaseIndentation
in interface IAppendable
increaseIndentation
in interface ISourceAppender
public IAppendable decreaseIndentation()
decreaseIndentation
in interface IAppendable
decreaseIndentation
in interface ISourceAppender
public void setScopeStack(ScopeStack scopes)
public void openScope()
IAppendable
openScope
in interface IAppendable
public void openPseudoScope()
IAppendable
openPseudoScope
in interface IAppendable
public java.lang.String declareVariable(java.lang.Object key, java.lang.String proposedName)
declareVariable
in interface IAppendable
public java.lang.String declareSyntheticVariable(java.lang.Object key, java.lang.String proposedName)
IAppendable
declareSyntheticVariable
in interface IAppendable
public java.lang.String declareUniqueNameVariable(java.lang.Object key, java.lang.String proposedName)
IAppendable
declareUniqueNameVariable
in interface IAppendable
public void closeScope()
closeScope
in interface IAppendable
public java.lang.String removeName(java.lang.Object key)
removeName
in interface IAppendable
protected abstract void appendType(JvmType type, java.lang.StringBuilder builder)
protected abstract void appendType(java.lang.Class<?> type, java.lang.StringBuilder builder)
@Deprecated public abstract java.util.List<java.lang.String> getImports()
getImports
in interface IAppendable
public java.lang.String getName(java.lang.Object key)
getName
in interface IAppendable
public boolean hasName(java.lang.Object key)
hasName
in interface IAppendable
public java.lang.Object getObject(java.lang.String name)
getObject
in interface IAppendable
public boolean hasObject(java.lang.String name)
hasObject
in interface IAppendable
protected java.lang.String getLineSeparator()
public char charAt(int index)
public java.lang.CharSequence subSequence(int start, int end)
public GeneratorConfig getGeneratorConfig()
getGeneratorConfig
in interface IAppendable
public void setGeneratorConfig(GeneratorConfig config)