• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / sitemesh2 / 59

22 Mar 2026 02:30AM UTC coverage: 40.347%. Remained the same
59

push

github

hazendaz
[mvn] Update maven wrapper

698 of 1891 branches covered (36.91%)

Branch coverage included in aggregate %.

1555 of 3693 relevant lines covered (42.11%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.19
/src/main/java/com/opensymphony/module/sitemesh/parser/TokenizedHTMLPage.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
package com.opensymphony.module.sitemesh.parser;
6

7
import com.opensymphony.module.sitemesh.SitemeshBuffer;
8
import com.opensymphony.module.sitemesh.SitemeshBufferFragment;
9
import com.opensymphony.module.sitemesh.SitemeshWriter;
10
import com.opensymphony.module.sitemesh.html.rules.PageBuilder;
11

12
import java.io.IOException;
13
import java.io.Writer;
14

15
/**
16
 * HTMLPage implementation that builds itself based on the incoming 'tag' and 'text' tokens fed to it from the
17
 * HTMLTagTokenizer.
18
 *
19
 * @author Joe Walnes
20
 *
21
 * @see com.opensymphony.module.sitemesh.parser.HTMLPageParser
22
 * @see com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer
23
 */
24
public class TokenizedHTMLPage extends AbstractHTMLPage implements PageBuilder {
25

26
    /** The body. */
27
    private SitemeshBufferFragment body;
28

29
    /** The head. */
30
    private SitemeshBufferFragment head;
31

32
    /**
33
     * Instantiates a new tokenized HTML page.
34
     *
35
     * @param sitemeshBuffer
36
     *            the sitemesh buffer
37
     */
38
    public TokenizedHTMLPage(SitemeshBuffer sitemeshBuffer) {
39
        super(sitemeshBuffer);
1✔
40
        addProperty("title", "");
1✔
41
    }
1✔
42

43
    /**
44
     * Sets the body.
45
     *
46
     * @param body
47
     *            the new body
48
     */
49
    public void setBody(SitemeshBufferFragment body) {
50
        this.body = body;
1✔
51
    }
1✔
52

53
    /**
54
     * Sets the head.
55
     *
56
     * @param head
57
     *            the new head
58
     */
59
    public void setHead(SitemeshBufferFragment head) {
60
        this.head = head;
1✔
61
    }
1✔
62

63
    @Override
64
    public void writeHead(Writer out) throws IOException {
65
        if (out instanceof SitemeshWriter) {
1!
66
            ((SitemeshWriter) out).writeSitemeshBufferFragment(head);
×
67
        } else {
68
            head.writeTo(out);
1✔
69
        }
70
    }
1✔
71

72
    @Override
73
    public void writeBody(Writer out) throws IOException {
74
        if (out instanceof SitemeshWriter) {
1!
75
            ((SitemeshWriter) out).writeSitemeshBufferFragment(body);
×
76
        } else {
77
            body.writeTo(out);
1✔
78
        }
79
    }
1✔
80

81
    @Override
82
    public String getHead() {
83
        return head.getStringContent();
×
84
    }
85

86
    @Override
87
    public String getBody() {
88
        return body.getStringContent();
1✔
89
    }
90
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc