Class AbstractStringBuilderBasedAppendable

    • Constructor Detail

      • AbstractStringBuilderBasedAppendable

        public AbstractStringBuilderBasedAppendable​(java.lang.String indentation,
                                                    java.lang.String lineSeparator,
                                                    boolean isJava)
      • AbstractStringBuilderBasedAppendable

        public AbstractStringBuilderBasedAppendable​(boolean isJava)
    • Method Detail

      • append

        public IAppendable append​(java.lang.Class<?> type)
      • getIndentationString

        protected java.lang.CharSequence getIndentationString()
      • getIndentationLevel

        protected int getIndentationLevel()
      • toString

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

        public void setScopeStack​(ScopeStack scopes)
      • 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
      • 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:
        getImports 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
      • getLineSeparator

        protected java.lang.String getLineSeparator()
      • charAt

        public char charAt​(int index)
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
      • setGeneratorConfig

        public void setGeneratorConfig​(GeneratorConfig config)