public class TreeAppendable extends java.lang.Object implements ITreeAppendable, IAcceptor<java.lang.String>, java.lang.CharSequence
Modifier and Type | Class and Description |
---|---|
static class |
TreeAppendable.Visitor
A
visitor can be used
to manipulate an existing TreeAppendable or to create a completely new one recursively. |
Modifier | Constructor and Description |
---|---|
|
TreeAppendable(ImportManager importManager,
ITraceURIConverter converter,
ILocationInFileProvider locationProvider,
IJvmModelAssociations jvmModelAssociations,
org.eclipse.emf.ecore.EObject source,
java.lang.String indentation,
java.lang.String lineSeparator) |
protected |
TreeAppendable(SharedAppendableState state,
ITraceURIConverter converter,
ILocationInFileProvider locationProvider,
IJvmModelAssociations jvmModelAssociations,
org.eclipse.emf.ecore.EObject source) |
protected |
TreeAppendable(SharedAppendableState state,
ITraceURIConverter converter,
ILocationInFileProvider locationProvider,
IJvmModelAssociations jvmModelAssociations,
java.util.Set<ILocationData> sourceLocations,
boolean useForDebugging) |
Modifier and Type | Method and Description |
---|---|
void |
accept(java.lang.String text) |
TreeAppendable |
acceptVisitor(TreeAppendable.Visitor visitor) |
ITreeAppendable |
append(java.lang.CharSequence content) |
ITreeAppendable |
append(java.lang.Class<?> type) |
TreeAppendable |
append(JvmType type) |
TreeAppendable |
append(LightweightTypeReference typeRef) |
protected void |
appendIndented(java.lang.String text) |
protected ITreeAppendable |
appendTreeAppendable(ITreeAppendable other) |
TreeAppendable |
appendUnsafe(java.lang.String string) |
char |
charAt(int index) |
protected void |
closeLastChild() |
void |
closeScope() |
protected static java.util.Set<ILocationData> |
createAllLocationData(ITraceURIConverter converter,
ILocationInFileProvider locationProvider,
IJvmModelAssociations jvmModelAssociations,
org.eclipse.emf.ecore.EObject object,
ILocationInFileProviderExtension.RegionDescription query,
boolean skipEmpty) |
protected TreeAppendable |
createChild(SharedAppendableState state,
ILocationInFileProvider locationProvider,
IJvmModelAssociations jvmModelAssociations,
java.util.Set<ILocationData> newData,
boolean useForDebugging) |
protected LightweightTypeReferenceSerializer |
createLightweightTypeReferenceSerializer() |
protected static ILocationData |
createLocationData(ITraceURIConverter converter,
org.eclipse.emf.ecore.EObject object,
ITextRegionWithLineInformation textRegion) |
protected static ILocationData |
createLocationData(ITraceURIConverter converter,
ILocationInFileProvider locationProvider,
org.eclipse.emf.ecore.EObject object,
ILocationInFileProviderExtension.RegionDescription query) |
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) |
TreeAppendable |
decreaseIndentation() |
protected void |
doGetContent(java.lang.StringBuilder result) |
void |
dump() |
protected void |
dump(java.lang.String indent) |
ErrorTreeAppendable |
errorChild() |
java.util.List<? extends java.lang.Object> |
getChildren()
Access the children of the
TreeAppendable . |
java.lang.String |
getContent() |
GeneratorConfig |
getGeneratorConfig() |
java.util.List<java.lang.String> |
getImports()
Deprecated.
|
java.util.Set<ILocationData> |
getLocationData() |
java.lang.String |
getName(java.lang.Object key) |
java.lang.Object |
getObject(java.lang.String name) |
SharedAppendableState |
getState() |
AbstractTraceRegion |
getTraceRegion()
Returns the a trace region.
|
ITraceURIConverter |
getTraceURIConverter() |
boolean |
hasName(java.lang.Object key) |
boolean |
hasObject(java.lang.String name) |
TreeAppendable |
increaseIndentation() |
protected boolean |
isClosed() |
boolean |
isJava() |
boolean |
isUseForDebugging() |
int |
length() |
protected void |
markClosed() |
TreeAppendable |
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) |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
TreeAppendable |
trace(org.eclipse.emf.ecore.EObject object)
same as trace(object, false)
|
TreeAppendable |
trace(org.eclipse.emf.ecore.EObject object,
boolean useForDebugging) |
ITreeAppendable |
trace(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.ecore.EStructuralFeature feature,
int indexInList) |
TreeAppendable |
trace(org.eclipse.emf.ecore.EObject object,
ILocationInFileProviderExtension.RegionDescription region,
boolean useForDebugging) |
ITreeAppendable |
trace(ILocationData location) |
ITreeAppendable |
trace(ILocationData location,
boolean useForDebugging) |
ITreeAppendable |
trace(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> objects) |
protected TreeAppendable |
trace(java.util.Set<ILocationData> newData,
boolean useForDebugging) |
public TreeAppendable(ImportManager importManager, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, org.eclipse.emf.ecore.EObject source, java.lang.String indentation, java.lang.String lineSeparator)
protected TreeAppendable(SharedAppendableState state, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, org.eclipse.emf.ecore.EObject source)
protected TreeAppendable(SharedAppendableState state, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, java.util.Set<ILocationData> sourceLocations, boolean useForDebugging)
protected LightweightTypeReferenceSerializer createLightweightTypeReferenceSerializer()
public boolean isJava()
isJava
in interface ISourceAppender
public ITraceURIConverter getTraceURIConverter()
public ErrorTreeAppendable errorChild()
errorChild
in interface ITreeAppendable
public TreeAppendable trace(org.eclipse.emf.ecore.EObject object)
ITreeAppendable
trace
in interface ITreeAppendable
public TreeAppendable trace(org.eclipse.emf.ecore.EObject object, boolean useForDebugging)
trace
in interface ITreeAppendable
object
- the object this part should be associated withuseForDebugging
- whether the part is relevant for debuggingpublic TreeAppendable trace(org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription region, boolean useForDebugging)
protected TreeAppendable trace(java.util.Set<ILocationData> newData, boolean useForDebugging)
protected TreeAppendable createChild(SharedAppendableState state, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, java.util.Set<ILocationData> newData, boolean useForDebugging)
public ITreeAppendable trace(ILocationData location)
trace
in interface ITreeAppendable
public ITreeAppendable trace(ILocationData location, boolean useForDebugging)
trace
in interface ITreeAppendable
location
- the location that should be traceduseForDebugging
- whether the part is relevant for debuggingprotected static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query)
protected static java.util.Set<ILocationData> createAllLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query, boolean skipEmpty)
public ITreeAppendable trace(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> objects)
trace
in interface ITreeAppendable
objects
- the iterable of EObject
s that contribute output. May not be empty.public ITreeAppendable trace(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)
trace
in interface ITreeAppendable
protected static ILocationData createLocationData(ITraceURIConverter converter, org.eclipse.emf.ecore.EObject object, ITextRegionWithLineInformation textRegion)
public TreeAppendable acceptVisitor(TreeAppendable.Visitor visitor)
public java.util.Set<ILocationData> getLocationData()
public java.util.List<? extends java.lang.Object> getChildren()
TreeAppendable
. The list contains either strings
or other TreeAppendables
. The list may be empty.public void accept(java.lang.String text)
protected void markClosed()
protected void closeLastChild()
protected boolean isClosed()
public TreeAppendable append(JvmType type)
append
in interface IAppendable
append
in interface ISourceAppender
append
in interface ITreeAppendable
public ITreeAppendable append(java.lang.Class<?> type)
append
in interface ITreeAppendable
public TreeAppendable append(LightweightTypeReference typeRef)
append
in interface IAppendable
append
in interface ISourceAppender
protected ITreeAppendable appendTreeAppendable(ITreeAppendable other)
public ITreeAppendable append(java.lang.CharSequence content)
append
in interface IAppendable
append
in interface ISourceAppender
append
in interface ITreeAppendable
public TreeAppendable appendUnsafe(java.lang.String string)
public TreeAppendable newLine()
newLine
in interface IAppendable
newLine
in interface ISourceAppender
newLine
in interface ITreeAppendable
public TreeAppendable increaseIndentation()
increaseIndentation
in interface IAppendable
increaseIndentation
in interface ISourceAppender
increaseIndentation
in interface ITreeAppendable
public TreeAppendable decreaseIndentation()
decreaseIndentation
in interface IAppendable
decreaseIndentation
in interface ISourceAppender
decreaseIndentation
in interface ITreeAppendable
@Deprecated public java.util.List<java.lang.String> getImports()
getImports
in interface IAppendable
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 java.lang.String removeName(java.lang.Object key)
removeName
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
public void closeScope()
closeScope
in interface IAppendable
public java.lang.String getContent()
getContent
in interface IAppendable
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in interface IAppendable
toString
in class java.lang.Object
protected void doGetContent(java.lang.StringBuilder result)
public int length()
length
in interface java.lang.CharSequence
length
in interface IAppendable
public AbstractTraceRegion getTraceRegion()
ITraceRegionProvider
getTraceRegion
in interface ITraceRegionProvider
protected void appendIndented(java.lang.String text)
public boolean isUseForDebugging()
public SharedAppendableState getState()
public void dump()
protected void dump(java.lang.String indent)
public GeneratorConfig getGeneratorConfig()
getGeneratorConfig
in interface IAppendable