Class JavaTemplate.Builder

  • Enclosing class:
    JavaTemplate

    public static class JavaTemplate.Builder
    extends java.lang.Object
    • Method Detail

      • imports

        public JavaTemplate.Builder imports​(java.lang.String... fullyQualifiedTypeNames)
        A list of fully-qualified types that will be added when generating/compiling snippets
         Examples:
         

        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)