Class CodeGenerationContext


  • public class CodeGenerationContext
    extends java.lang.Object
    Context for generating Bamboo Specs code.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decIndentation()
      Decrement code indentation.
      java.util.Set<java.lang.String> getImports()  
      int getIndentationLevel()
      Current indentation level.
      java.lang.String importClassName​(java.lang.Class clazz)
      Adds a class to the list of classes used in the generated code.
      java.lang.String incIndentation()
      Increment code indentation.
      java.lang.String newLine()
      Produces a string with new line followed by a number of spaces determined according to the current indentation level.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CodeGenerationContext

        public CodeGenerationContext()
    • Method Detail

      • incIndentation

        public java.lang.String incIndentation()
        Increment code indentation.
      • decIndentation

        public java.lang.String decIndentation()
        Decrement code indentation.
      • importClassName

        public java.lang.String importClassName​(java.lang.Class clazz)
        Adds a class to the list of classes used in the generated code. The resulting list is used to generate import statements
        Parameters:
        clazz - class object
        Returns:
        class short name
      • newLine

        public java.lang.String newLine()
        Produces a string with new line followed by a number of spaces determined according to the current indentation level.
      • getIndentationLevel

        public int getIndentationLevel()
        Current indentation level.
        Returns:
        current indentation level.
      • getImports

        public java.util.Set<java.lang.String> getImports()