private void generateGetRenderFunction ( ComponentExposedTypeGenerator exposedTypeGenerator , VueTemplateCompilerResult result , TemplateParserResult templateParserResult ) { MethodSpec . Builder getRenderFunctionBuilder = MethodSpec . methodBuilder ( "getRenderFunction" ) . addModifiers ( Modifier . PRIVATE ) . returns ( Function . class ) . addStatement ( "String renderFunctionString = $S" , result . getRenderFunction ( ) ) ; for ( VariableInfo vModelField : templateParserResult . getvModelDataFields ( ) ) { String placeHolderVModelValue = vModelFieldToPlaceHolderField ( vModelField . getName ( ) ) ; String fieldName = vModelField . getName ( ) ; if ( vModelField instanceof ComputedVariableInfo ) fieldName = ( ( ComputedVariableInfo ) vModelField ) . getFieldName ( ) ; getRenderFunctionBuilder . addStatement ( "renderFunctionString = $T.replaceVariableInRenderFunction(renderFunctionString, $S, this, () -> this.$L = $L)" , VueGWTTools . class , placeHolderVModelValue , fieldName , getFieldMarkingValueForType ( vModelField . getType ( ) ) ) ; } getRenderFunctionBuilder . addStatement ( "return new $T(renderFunctionString)" , Function . class ) ; exposedTypeGenerator . getClassBuilder ( ) . addMethod ( getRenderFunctionBuilder . build ( ) ) ; }
Generate the method that returns the body of the render function .