Package org.openrewrite.java
Class JavaTemplate.Builder
- java.lang.Object
-
- org.openrewrite.java.JavaTemplate.Builder
-
- Enclosing class:
- JavaTemplate
public static class JavaTemplate.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaTemplate
build()
JavaTemplate.Builder
doAfterVariableSubstitution(java.util.function.Consumer<java.lang.String> afterVariableSubstitution)
JavaTemplate.Builder
doBeforeParseTemplate(java.util.function.Consumer<java.lang.String> beforeParseTemplate)
JavaTemplate.Builder
imports(java.lang.String... fullyQualifiedTypeNames)
A list of fully-qualified types that will be added when generating/compiling snippetsJavaTemplate.Builder
javaParser(org.openrewrite.java.JavaParser javaParser)
JavaTemplate.Builder
parameterMarker(java.lang.String parameterMarker)
Define an alternate marker to denote where a parameter should be inserted into the template.JavaTemplate.Builder
staticImports(java.lang.String... fullyQualifiedMemberTypeNames)
A list of fully-qualified member type names that will be statically imported when generating/compiling snippets.
-
-
-
Method Detail
-
imports
public JavaTemplate.Builder imports(java.lang.String... fullyQualifiedTypeNames)
A list of fully-qualified types that will be added when generating/compiling snippetsExamples:
java.util.Collections java.util.Date
-
staticImports
public JavaTemplate.Builder staticImports(java.lang.String... fullyQualifiedMemberTypeNames)
A list of fully-qualified member type names that will be statically imported when generating/compiling snippets.Examples:
java.util.Collections.emptyList java.util.Collections.*
-
javaParser
public JavaTemplate.Builder javaParser(org.openrewrite.java.JavaParser javaParser)
-
parameterMarker
public JavaTemplate.Builder parameterMarker(java.lang.String parameterMarker)
Define an alternate marker to denote where a parameter should be inserted into the template. If not specified, the default format for parameter marker is "#{}"
-
doAfterVariableSubstitution
public JavaTemplate.Builder doAfterVariableSubstitution(java.util.function.Consumer<java.lang.String> afterVariableSubstitution)
-
doBeforeParseTemplate
public JavaTemplate.Builder doBeforeParseTemplate(java.util.function.Consumer<java.lang.String> beforeParseTemplate)
-
build
public JavaTemplate build()
-
-