Class CodeGenerationContext
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.codegen.CodeGenerationContext
-
public class CodeGenerationContext extends Object
Context for generating Bamboo Specs code.
-
-
Constructor Summary
Constructors Constructor Description CodeGenerationContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdecIndentation()Decrement code indentation.Set<String>getImports()intgetIndentationLevel()Current indentation level.StringimportClassName(Class clazz)Adds a class to the list of classes used in the generated code.StringincIndentation()Increment code indentation.StringnewLine()Produces a string with new line followed by a number of spaces determined according to the current indentation level.
-
-
-
Method Detail
-
incIndentation
public String incIndentation()
Increment code indentation.
-
decIndentation
public String decIndentation()
Decrement code indentation.
-
importClassName
public String importClassName(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 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.
-
-