Class CodeGenerator
java.lang.Object
com.illumon.iris.db.v2.utils.codegen.CodeGenerator
public abstract class CodeGenerator extends Object
-
Constructor Summary
Constructors Constructor Description CodeGenerator() -
Method Summary
Modifier and Type Method Description voidactivateAllChoices(String tag)voidactivateAllOptionals(String tag)CodeGeneratoractivateChoice(String tag)CodeGeneratoractivateOptional(String tag)voidassertNoUnresolvedVariables()static CodeGeneratorblock(Object... args)Open new block.Stringbuild()static CodeGeneratorchoice(Object... args)Same "tail wagging the dog" comment applies.static CodeGeneratorcreate(Object... args)CodeGeneratorfreeze()static CodeGeneratorindent(Object... args)Begin new indentation scope, e.g.CodeGeneratorinstantiateNewRepeated(String tag)static CodeGeneratoroptional(Object... args)Same "tail wagging the dog" comment applies.static CodeGeneratorrepeated(Object... args)Same "tail wagging the dog" comment applies.voidreplace(String metaVariable, String replacement)static 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()
-