• 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

88.57
/src/main/java/com/opensymphony/module/sitemesh/parser/FastPage.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
/*
6
 * Title:        FastPage
7
 * Description:
8
 *
9
 * This software is published under the terms of the OpenSymphony Software
10
 * License version 1.1, of which a copy has been included with this
11
 * distribution in the LICENSE.txt file.
12
 */
13

14
package com.opensymphony.module.sitemesh.parser;
15

16
import com.opensymphony.module.sitemesh.SitemeshBuffer;
17

18
import java.io.IOException;
19
import java.io.Writer;
20
import java.util.Map;
21

22
/**
23
 * HTMLPage implementation produced by FastPageParser.
24
 *
25
 * @author <a href="mailto:salaman@qoretech.com">Victor Salaman</a>
26
 */
27
public final class FastPage extends AbstractHTMLPage {
28

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

32
    /** The body. */
33
    private String body;
34

35
    /**
36
     * Instantiates a new fast page.
37
     *
38
     * @param sitemeshBuffer
39
     *            the sitemesh buffer
40
     * @param sitemeshProps
41
     *            the sitemesh props
42
     * @param htmlProps
43
     *            the html props
44
     * @param metaProps
45
     *            the meta props
46
     * @param bodyProps
47
     *            the body props
48
     * @param title
49
     *            the title
50
     * @param head
51
     *            the head
52
     * @param body
53
     *            the body
54
     * @param frameSet
55
     *            the frame set
56
     */
57
    public FastPage(SitemeshBuffer sitemeshBuffer, Map<String, String> sitemeshProps, Map<String, String> htmlProps,
58
            Map<String, String> metaProps, Map<String, String> bodyProps, String title, String head, String body,
59
            boolean frameSet) {
60
        super(sitemeshBuffer);
1✔
61
        this.head = head;
1✔
62
        this.body = body;
1✔
63
        setFrameSet(frameSet);
1✔
64
        addAttributeList("", htmlProps);
1✔
65
        addAttributeList("page.", sitemeshProps);
1✔
66
        addAttributeList("body.", bodyProps);
1✔
67
        addAttributeList("meta.", metaProps);
1✔
68
        addProperty("title", title);
1✔
69
    }
1✔
70

71
    @Override
72
    public void writeHead(Writer out) throws IOException {
73
        out.write(head);
1✔
74
    }
1✔
75

76
    @Override
77
    public void writeBody(Writer out) throws IOException {
78
        out.write(body);
1✔
79
    }
1✔
80

81
    /**
82
     * Adds the attribute list.
83
     *
84
     * @param prefix
85
     *            the prefix
86
     * @param attributes
87
     *            the attributes
88
     */
89
    private void addAttributeList(String prefix, Map<String, String> attributes) {
90
        if (attributes == null || attributes.isEmpty()) {
1✔
91
            return;
1✔
92
        }
93

94
        String name;
95
        String value;
96
        for (Map.Entry<String, String> entry : attributes.entrySet()) {
1✔
97
            name = entry.getKey();
1✔
98
            value = entry.getValue();
1✔
99

100
            if (value != null && value.trim().length() > 0) {
1!
101
                addProperty(prefix + name, value);
1✔
102
            }
103
        }
1✔
104
    }
1✔
105

106
    @Override
107
    public String getBody() {
108
        return body;
×
109
    }
110

111
    @Override
112
    public String getHead() {
113
        return head;
×
114
    }
115
}
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