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 ISourceAppenderpublic IAppendable append(JvmType type)
append in interface IAppendableappend in interface ISourceAppenderpublic IAppendable append(java.lang.Class<?> type)
public IAppendable append(LightweightTypeReference typeRef)
append in interface IAppendableappend in interface ISourceAppenderprotected LightweightTypeReferenceSerializer createLightweightTypeReferenceSerializer()
public IAppendable append(java.lang.CharSequence string)
append in interface IAppendableappend in interface ISourceAppenderpublic IAppendable newLine()
newLine in interface IAppendablenewLine in interface ISourceAppenderprotected java.lang.CharSequence getIndentationString()
protected int getIndentationLevel()
public java.lang.String toString()
toString in interface IAppendabletoString in class java.lang.Objectpublic java.lang.String getContent()
getContent in interface IAppendablepublic int length()
length in interface IAppendablepublic IAppendable increaseIndentation()
increaseIndentation in interface IAppendableincreaseIndentation in interface ISourceAppenderpublic IAppendable decreaseIndentation()
decreaseIndentation in interface IAppendabledecreaseIndentation in interface ISourceAppenderpublic void setScopeStack(ScopeStack scopes)
public void openScope()
IAppendableopenScope in interface IAppendablepublic void openPseudoScope()
IAppendableopenPseudoScope in interface IAppendablepublic java.lang.String declareVariable(java.lang.Object key,
java.lang.String proposedName)
declareVariable in interface IAppendablepublic java.lang.String declareSyntheticVariable(java.lang.Object key,
java.lang.String proposedName)
IAppendabledeclareSyntheticVariable in interface IAppendablepublic java.lang.String declareUniqueNameVariable(java.lang.Object key,
java.lang.String proposedName)
IAppendabledeclareUniqueNameVariable in interface IAppendablepublic void closeScope()
closeScope in interface IAppendablepublic java.lang.String removeName(java.lang.Object key)
removeName in interface IAppendableprotected 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 IAppendablepublic java.lang.String getName(java.lang.Object key)
getName in interface IAppendablepublic boolean hasName(java.lang.Object key)
hasName in interface IAppendablepublic java.lang.Object getObject(java.lang.String name)
getObject in interface IAppendablepublic boolean hasObject(java.lang.String name)
hasObject in interface IAppendableprotected java.lang.String getLineSeparator()
public char charAt(int index)
public java.lang.CharSequence subSequence(int start,
int end)
public GeneratorConfig getGeneratorConfig()
getGeneratorConfig in interface IAppendablepublic void setGeneratorConfig(GeneratorConfig config)