Class CodeGenerator
java.lang.Object
com.illumon.iris.db.v2.utils.codegen.CodeGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidactivateAllChoices(String tag) final voidfinal CodeGeneratoractivateChoice(String tag) final CodeGeneratoractivateOptional(String tag) voidstatic CodeGeneratorOpen new block.final Stringbuild()static CodeGeneratorSame "tail wagging the dog" comment applies.static CodeGeneratorfinal CodeGeneratorfreeze()static CodeGeneratorBegin new indentation scope, e.g.final CodeGeneratorstatic CodeGeneratorSame "tail wagging the dog" comment applies.static CodeGeneratorSame "tail wagging the dog" comment applies.final voidstatic CodeGeneratorsamelineBlock(Object... args) The tail wagging the dog: the proper method signature for this method isCodeGenerator samelineBlock(String prefix, Object... args)But when I do that, IntelliJ by default litters up the code with parameter hints, which (if the programmer doesn't turn them off), makes the templated code much more unreadable.
-
Constructor Details
-
CodeGenerator
public CodeGenerator()
-
-
Method Details
-
create
-
block
Open new block. Opening brace on same line. -
indent
Begin new indentation scope, e.g. to format multiple lines of function parameters. -
samelineBlock
The tail wagging the dog: the proper method signature for this method isCodeGenerator samelineBlock(String prefix, Object... args)But when I do that, IntelliJ by default litters up the code with parameter hints, which (if the programmer doesn't turn them off), makes the templated code much more unreadable. So instead we just pull out the parameter from here.- Parameters:
args- A prefix (of type String) like "else", followed by an arbitrary number of template lines.- Returns:
- The new component.
-
optional
Same "tail wagging the dog" comment applies. -
choice
Same "tail wagging the dog" comment applies. -
repeated
Same "tail wagging the dog" comment applies. -
replace
-
activateOptional
-
activateChoice
-
activateAllOptionals
-
activateAllChoices
-
instantiateNewRepeated
-
build
-
freeze
-
assertNoUnresolvedVariables
public void assertNoUnresolvedVariables()
-