private ThymeleafTemplater getOrCreateTemplater ( ) { ThymeleafTemplater templater = this . templater . get ( ) ; // Lazy-create a ThymeleafTemplater if ( templater == null ) { final TemplateEngine engine = getOrCreateEngine ( ) ; templater = new ThymeleafTemplater ( engine , configuration , metrics , userProvider ) ; templater . set ( "coreRestPrefix" , coreRestPrefix ) ; templater . set ( "coreRestEndpoint" , coreRestEndpoint . toString ( ) ) ; templater . set ( "coreServices" , services ) ; templater . set ( "currentUser" , new ThymeleafCurrentUserUtils ( userProvider ) ) ; this . templater = new WeakReference <> ( templater ) ; } return templater ; }
Retrieve or build a Thymeleaf templater