This will invoke the HtmlTemplate to a PreprocessingVisitor that collects a chain of HtmlContinuation objects containing the static HTML strings and dynamic HTML consumers. @param template An HtmlTemplate function, which depends on an HtmlView used to create HTMl elements. @param isIndented Set
(
HtmlTemplate template,
boolean isIndented
)
| 51 | * @param isIndented Set indentation on or off. |
| 52 | */ |
| 53 | private static PreprocessingVisitor preprocessing( |
| 54 | HtmlTemplate template, |
| 55 | boolean isIndented |
| 56 | ) { |
| 57 | PreprocessingVisitor pre = new PreprocessingVisitor(isIndented); |
| 58 | HtmlView<?> preView = new HtmlView<>(() -> pre, template, false); |
| 59 | /* |
| 60 | * 1st Performs rendering by invoking the function defined as the template, collecting the |
| 61 | * resulting static HTML into an internal StringBuffer. |
| 62 | */ |
| 63 | template.resolve(preView); |
| 64 | /* |
| 65 | * NO problem with null model. We are just preprocessing static HTML blocks. |
| 66 | * Thus, dynamic blocks which depend on model are not invoked. |
| 67 | * 2nd Simply invokes resolve in PreprocessingVisitor, which creates only |
| 68 | * the final HtmlContinuationSyncStatic containing the remaining static HTML |
| 69 | * accumulated in the internal StringBuffer out. |
| 70 | */ |
| 71 | preView.getVisitor().resolve(null); |
| 72 | return pre; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Performs preprocessing for Micro Frontend (MFE) views. Creates a specialized visitor that collects |
no test coverage detected