MCPcopy Create free account
hub / github.com/xmlet/HtmlFlow / preprocessing

Method preprocessing

htmlflow-core/src/main/java/htmlflow/HtmlFlow.java:53–73  ·  view source on GitHub ↗

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
    )

Source from the content-addressed store, hash-verified

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

Callers 1

viewMethod · 0.95

Calls 2

getVisitorMethod · 0.95
resolveMethod · 0.65

Tested by

no test coverage detected