Auxiliary constructor used by clone().
(
Supplier<HtmlVisitor> visitorSupplier,
HtmlTemplate template,
boolean threadSafe
)
| 61 | |
| 62 | /** Auxiliary constructor used by clone(). */ |
| 63 | HtmlView( |
| 64 | Supplier<HtmlVisitor> visitorSupplier, |
| 65 | HtmlTemplate template, |
| 66 | boolean threadSafe |
| 67 | ) { |
| 68 | this.visitorSupplier = visitorSupplier; |
| 69 | this.template = template; |
| 70 | this.threadSafe = threadSafe; |
| 71 | if (threadSafe) { |
| 72 | this.visitor = null; |
| 73 | this.threadLocalVisitor = ThreadLocal.withInitial(visitorSupplier); |
| 74 | } else { |
| 75 | this.visitor = visitorSupplier.get(); |
| 76 | this.threadLocalVisitor = null; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | public final Html<HtmlPage> html() { |
| 81 | this.getVisitor().write(HEADER); |