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

hazendaz / httpunit / 755

14 Feb 2026 07:14PM UTC coverage: 80.526%. Remained the same
755

push

github

hazendaz
[ci] Fix badge

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10124 relevant lines covered (81.44%)

0.81 hits per line

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

86.21
/src/main/java/com/meterware/httpunit/dom/HTMLAreaElementImpl.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2000-2026 Russell Gold
6
 * Copyright 2021-2000 hazendaz
7
 */
8
package com.meterware.httpunit.dom;
9

10
import java.net.MalformedURLException;
11
import java.net.URL;
12

13
import org.w3c.dom.html.HTMLAreaElement;
14

15
/**
16
 * The Class HTMLAreaElementImpl.
17
 */
18
public class HTMLAreaElementImpl extends HTMLElementImpl implements HTMLAreaElement {
1✔
19

20
    /** The Constant serialVersionUID. */
21
    private static final long serialVersionUID = 1L;
22

23
    @Override
24
    ElementImpl create() {
25
        return new HTMLAreaElementImpl();
1✔
26
    }
27

28
    /**
29
     * Gets the href.
30
     *
31
     * @return the href
32
     */
33
    @Override
34
    public String getHref() {
35
        try {
36
            return new URL(((HTMLDocumentImpl) getOwnerDocument()).getWindow().getUrl(),
×
37
                    getAttributeWithNoDefault("href")).toExternalForm();
×
38
        } catch (MalformedURLException e) {
×
39
            return e.toString();
×
40
        }
41
    }
42

43
    /**
44
     * Gets the target.
45
     *
46
     * @return the target
47
     */
48
    @Override
49
    public String getTarget() {
50
        return getAttributeWithNoDefault("target");
1✔
51
    }
52

53
    /**
54
     * Sets the href.
55
     *
56
     * @param href
57
     *            the new href
58
     */
59
    @Override
60
    public void setHref(String href) {
61
        setAttribute("href", href);
1✔
62
    }
1✔
63

64
    /**
65
     * Sets the target.
66
     *
67
     * @param target
68
     *            the new target
69
     */
70
    @Override
71
    public void setTarget(String target) {
72
        setAttribute("target", target);
1✔
73
    }
1✔
74

75
    /**
76
     * Gets the access key.
77
     *
78
     * @return the access key
79
     */
80
    @Override
81
    public String getAccessKey() {
82
        return getAttributeWithNoDefault("accesskey");
1✔
83
    }
84

85
    /**
86
     * Gets the coords.
87
     *
88
     * @return the coords
89
     */
90
    @Override
91
    public String getCoords() {
92
        return getAttributeWithNoDefault("coords");
1✔
93
    }
94

95
    /**
96
     * Gets the shape.
97
     *
98
     * @return the shape
99
     */
100
    @Override
101
    public String getShape() {
102
        return getAttributeWithNoDefault("shape");
1✔
103
    }
104

105
    /**
106
     * Gets the tab index.
107
     *
108
     * @return the tab index
109
     */
110
    @Override
111
    public int getTabIndex() {
112
        return getIntegerAttribute("tabindex");
1✔
113
    }
114

115
    /**
116
     * Sets the access key.
117
     *
118
     * @param accessKey
119
     *            the new access key
120
     */
121
    @Override
122
    public void setAccessKey(String accessKey) {
123
        setAttribute("accesskey", accessKey);
1✔
124
    }
1✔
125

126
    /**
127
     * Sets the coords.
128
     *
129
     * @param coords
130
     *            the new coords
131
     */
132
    @Override
133
    public void setCoords(String coords) {
134
        setAttribute("coords", coords);
1✔
135
    }
1✔
136

137
    /**
138
     * Sets the shape.
139
     *
140
     * @param shape
141
     *            the new shape
142
     */
143
    @Override
144
    public void setShape(String shape) {
145
        setAttribute("shape", shape);
1✔
146
    }
1✔
147

148
    /**
149
     * Sets the tab index.
150
     *
151
     * @param tabIndex
152
     *            the new tab index
153
     */
154
    @Override
155
    public void setTabIndex(int tabIndex) {
156
        setAttribute("tabindex", tabIndex);
1✔
157
    }
1✔
158

159
    /**
160
     * Gets the alt.
161
     *
162
     * @return the alt
163
     */
164
    @Override
165
    public String getAlt() {
166
        return getAttributeWithNoDefault("alt");
1✔
167
    }
168

169
    /**
170
     * Gets the no href.
171
     *
172
     * @return the no href
173
     */
174
    @Override
175
    public boolean getNoHref() {
176
        return getBooleanAttribute("nohref");
1✔
177
    }
178

179
    /**
180
     * Sets the alt.
181
     *
182
     * @param alt
183
     *            the new alt
184
     */
185
    @Override
186
    public void setAlt(String alt) {
187
        setAttribute("alt", alt);
1✔
188
    }
1✔
189

190
    /**
191
     * Sets the no href.
192
     *
193
     * @param noHref
194
     *            the new no href
195
     */
196
    @Override
197
    public void setNoHref(boolean noHref) {
198
        setAttribute("nohref", noHref);
1✔
199
    }
1✔
200
}
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