Class TreeAppendable

  • All Implemented Interfaces:
    java.lang.CharSequence, org.eclipse.xtext.generator.trace.ITraceRegionProvider, org.eclipse.xtext.util.IAcceptor<java.lang.String>, IAppendable, ISourceAppender, ITreeAppendable
    Direct Known Subclasses:
    ErrorTreeAppendable

    public class TreeAppendable
    extends java.lang.Object
    implements ITreeAppendable, org.eclipse.xtext.util.IAcceptor<java.lang.String>, java.lang.CharSequence
    • Constructor Detail

      • TreeAppendable

        public TreeAppendable​(ImportManager importManager,
                              org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                              org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                              IJvmModelAssociations jvmModelAssociations,
                              org.eclipse.emf.ecore.EObject source,
                              java.lang.String indentation,
                              java.lang.String lineSeparator)
      • TreeAppendable

        protected TreeAppendable​(SharedAppendableState state,
                                 org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                                 org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                                 IJvmModelAssociations jvmModelAssociations,
                                 org.eclipse.emf.ecore.EObject source)
      • TreeAppendable

        protected TreeAppendable​(SharedAppendableState state,
                                 org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                                 org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                                 IJvmModelAssociations jvmModelAssociations,
                                 java.util.Set<org.eclipse.xtext.generator.trace.ILocationData> sourceLocations,
                                 boolean useForDebugging)
    • Method Detail

      • getTraceURIConverter

        public org.eclipse.xtext.generator.trace.ITraceURIConverter getTraceURIConverter()
      • trace

        public TreeAppendable trace​(org.eclipse.emf.ecore.EObject object,
                                    boolean useForDebugging)
        Specified by:
        trace in interface ITreeAppendable
        Parameters:
        object - the object this part should be associated with
        useForDebugging - whether the part is relevant for debugging
      • trace

        public TreeAppendable trace​(org.eclipse.emf.ecore.EObject object,
                                    org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription region,
                                    boolean useForDebugging)
      • trace

        protected TreeAppendable trace​(java.util.Set<org.eclipse.xtext.generator.trace.ILocationData> newData,
                                       boolean useForDebugging)
      • createChild

        protected TreeAppendable createChild​(SharedAppendableState state,
                                             org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                                             IJvmModelAssociations jvmModelAssociations,
                                             java.util.Set<org.eclipse.xtext.generator.trace.ILocationData> newData,
                                             boolean useForDebugging)
        Since:
        2.4
      • trace

        public ITreeAppendable trace​(org.eclipse.xtext.generator.trace.ILocationData location,
                                     boolean useForDebugging)
        Specified by:
        trace in interface ITreeAppendable
        Parameters:
        location - the location that should be traced
        useForDebugging - whether the part is relevant for debugging
      • createLocationData

        protected static org.eclipse.xtext.generator.trace.ILocationData createLocationData​(org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                                                                                            org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                                                                                            org.eclipse.emf.ecore.EObject object,
                                                                                            org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription query)
      • createAllLocationData

        protected static java.util.Set<org.eclipse.xtext.generator.trace.ILocationData> createAllLocationData​(org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                                                                                                              org.eclipse.xtext.resource.ILocationInFileProvider locationProvider,
                                                                                                              IJvmModelAssociations jvmModelAssociations,
                                                                                                              org.eclipse.emf.ecore.EObject object,
                                                                                                              org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription query,
                                                                                                              boolean skipEmpty)
      • trace

        public ITreeAppendable trace​(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> objects)
        Specified by:
        trace in interface ITreeAppendable
        Parameters:
        objects - the iterable of EObjects that contribute output. May not be empty.
      • trace

        public ITreeAppendable trace​(org.eclipse.emf.ecore.EObject object,
                                     org.eclipse.emf.ecore.EStructuralFeature feature,
                                     int indexInList)
        Specified by:
        trace in interface ITreeAppendable
      • createLocationData

        protected static org.eclipse.xtext.generator.trace.ILocationData createLocationData​(org.eclipse.xtext.generator.trace.ITraceURIConverter converter,
                                                                                            org.eclipse.emf.ecore.EObject object,
                                                                                            org.eclipse.xtext.util.ITextRegionWithLineInformation textRegion)
      • getLocationData

        public java.util.Set<org.eclipse.xtext.generator.trace.ILocationData> getLocationData()
      • getChildren

        public java.util.List<? extends java.lang.Object> getChildren()
        Access the children of the TreeAppendable. The list contains either strings or other TreeAppendables. The list may be empty.
        Returns:
        the children of this appendable.
      • accept

        public void accept​(java.lang.String text)
        Specified by:
        accept in interface org.eclipse.xtext.util.IAcceptor<java.lang.String>
        Noreference:
        This method is not intended to be referenced by clients.
      • markClosed

        protected void markClosed()
      • closeLastChild

        protected void closeLastChild()
      • isClosed

        protected boolean isClosed()
      • append

        public ITreeAppendable append​(java.lang.CharSequence content)
        Description copied from interface: ITreeAppendable
        Appends the specified character sequence to this ITreeAppendable.
        Specified by:
        append in interface IAppendable
        Specified by:
        append in interface ISourceAppender
        Specified by:
        append in interface ITreeAppendable
        Parameters:
        content - - not null
        Returns:
        reference to an ITreeAppendable where the given content got appended
      • appendUnsafe

        public TreeAppendable appendUnsafe​(java.lang.String string)
      • getImports

        @Deprecated
        public java.util.List<java.lang.String> getImports()
        Deprecated.
        Specified by:
        getImports in interface IAppendable
      • 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 except by other synthetic variables.
        Specified by:
        declareSyntheticVariable in interface IAppendable
      • declareUniqueNameVariable

        public java.lang.String declareUniqueNameVariable​(java.lang.Object key,
                                                          java.lang.String proposedName)
        Description copied from interface: IAppendable
        Declares 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:
        declareUniqueNameVariable in interface IAppendable
      • removeName

        public java.lang.String removeName​(java.lang.Object key)
        Specified by:
        removeName in interface IAppendable
      • 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
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • toString

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

        protected void doGetContent​(java.lang.StringBuilder result)
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
        Specified by:
        length in interface IAppendable
      • getTraceRegion

        public org.eclipse.xtext.generator.trace.AbstractTraceRegion getTraceRegion()
        Specified by:
        getTraceRegion in interface org.eclipse.xtext.generator.trace.ITraceRegionProvider
      • appendIndented

        protected void appendIndented​(java.lang.String text)
      • isUseForDebugging

        public boolean isUseForDebugging()
      • dump

        public void dump()
        Since:
        2.4
        Noreference:
        This method is not intended to be referenced by clients.
        Nooverride:
        This method is not intended to be re-implemented or extended by clients.
      • dump

        protected void dump​(java.lang.String indent)
        Since:
        2.4
        Noreference:
        This method is not intended to be referenced by clients.
        Nooverride:
        This method is not intended to be re-implemented or extended by clients.