public List < String > genJsSrc ( SoyFileSetNode soyTree , TemplateRegistry registry , SoyIncrementalDomSrcOptions options , ErrorReporter errorReporter ) { SoyJsSrcOptions incrementalJSSrcOptions = options . toJsSrcOptions ( ) ; BidiGlobalDir bidiGlobalDir = SoyBidiUtils . decodeBidiGlobalDirFromJsOptions ( incrementalJSSrcOptions . getBidiGlobalDir ( ) , incrementalJSSrcOptions . getUseGoogIsRtlForBidiGlobalDir ( ) ) ; try ( SoyScopedData . InScope inScope = apiCallScope . enter ( /* msgBundle= */ null , bidiGlobalDir ) ) { // Do the code generation. new HtmlContextVisitor ( ) . exec ( soyTree ) ; // If any errors are reported in {@code HtmlContextVisitor}, we should not continue. // Return an empty list here, {@code SoyFileSet} will throw an exception. if ( errorReporter . hasErrors ( ) ) { return Collections . emptyList ( ) ; } UnescapingVisitor . unescapeRawTextInHtml ( soyTree ) ; new RemoveUnnecessaryEscapingDirectives ( bidiGlobalDir ) . run ( soyTree ) ; // some of the above passes may slice up raw text nodes, recombine them. new CombineConsecutiveRawTextNodesPass ( ) . run ( soyTree ) ; return createVisitor ( incrementalJSSrcOptions , registry , typeRegistry , inScope . getBidiGlobalDir ( ) , errorReporter ) . gen ( soyTree , registry , errorReporter ) ; } }
Generates Incremental DOM JS source code given a Soy parse tree an options object and an optional bundle of translated messages .