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

hazendaz / httpunit / 656

06 Dec 2025 09:11PM UTC coverage: 80.452% (+0.02%) from 80.435%
656

push

github

hazendaz
[maven-release-plugin] prepare for next development iteration

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10137 relevant lines covered (81.34%)

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
 * MIT License
3
 *
4
 * Copyright 2011-2025 Russell Gold
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
 *
11
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
 * of the Software.
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
15
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
 * DEALINGS IN THE SOFTWARE.
19
 */
20
package com.meterware.httpunit.dom;
21

22
import java.net.MalformedURLException;
23
import java.net.URL;
24

25
import org.w3c.dom.html.HTMLAreaElement;
26

27
/**
28
 * The Class HTMLAreaElementImpl.
29
 */
30
public class HTMLAreaElementImpl extends HTMLElementImpl implements HTMLAreaElement {
1✔
31

32
    /** The Constant serialVersionUID. */
33
    private static final long serialVersionUID = 1L;
34

35
    @Override
36
    ElementImpl create() {
37
        return new HTMLAreaElementImpl();
1✔
38
    }
39

40
    /**
41
     * Gets the href.
42
     *
43
     * @return the href
44
     */
45
    @Override
46
    public String getHref() {
47
        try {
48
            return new URL(((HTMLDocumentImpl) getOwnerDocument()).getWindow().getUrl(),
×
49
                    getAttributeWithNoDefault("href")).toExternalForm();
×
50
        } catch (MalformedURLException e) {
×
51
            return e.toString();
×
52
        }
53
    }
54

55
    /**
56
     * Gets the target.
57
     *
58
     * @return the target
59
     */
60
    @Override
61
    public String getTarget() {
62
        return getAttributeWithNoDefault("target");
1✔
63
    }
64

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

76
    /**
77
     * Sets the target.
78
     *
79
     * @param target
80
     *            the new target
81
     */
82
    @Override
83
    public void setTarget(String target) {
84
        setAttribute("target", target);
1✔
85
    }
1✔
86

87
    /**
88
     * Gets the access key.
89
     *
90
     * @return the access key
91
     */
92
    @Override
93
    public String getAccessKey() {
94
        return getAttributeWithNoDefault("accesskey");
1✔
95
    }
96

97
    /**
98
     * Gets the coords.
99
     *
100
     * @return the coords
101
     */
102
    @Override
103
    public String getCoords() {
104
        return getAttributeWithNoDefault("coords");
1✔
105
    }
106

107
    /**
108
     * Gets the shape.
109
     *
110
     * @return the shape
111
     */
112
    @Override
113
    public String getShape() {
114
        return getAttributeWithNoDefault("shape");
1✔
115
    }
116

117
    /**
118
     * Gets the tab index.
119
     *
120
     * @return the tab index
121
     */
122
    @Override
123
    public int getTabIndex() {
124
        return getIntegerAttribute("tabindex");
1✔
125
    }
126

127
    /**
128
     * Sets the access key.
129
     *
130
     * @param accessKey
131
     *            the new access key
132
     */
133
    @Override
134
    public void setAccessKey(String accessKey) {
135
        setAttribute("accesskey", accessKey);
1✔
136
    }
1✔
137

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

149
    /**
150
     * Sets the shape.
151
     *
152
     * @param shape
153
     *            the new shape
154
     */
155
    @Override
156
    public void setShape(String shape) {
157
        setAttribute("shape", shape);
1✔
158
    }
1✔
159

160
    /**
161
     * Sets the tab index.
162
     *
163
     * @param tabIndex
164
     *            the new tab index
165
     */
166
    @Override
167
    public void setTabIndex(int tabIndex) {
168
        setAttribute("tabindex", tabIndex);
1✔
169
    }
1✔
170

171
    /**
172
     * Gets the alt.
173
     *
174
     * @return the alt
175
     */
176
    @Override
177
    public String getAlt() {
178
        return getAttributeWithNoDefault("alt");
1✔
179
    }
180

181
    /**
182
     * Gets the no href.
183
     *
184
     * @return the no href
185
     */
186
    @Override
187
    public boolean getNoHref() {
188
        return getBooleanAttribute("nohref");
1✔
189
    }
190

191
    /**
192
     * Sets the alt.
193
     *
194
     * @param alt
195
     *            the new alt
196
     */
197
    @Override
198
    public void setAlt(String alt) {
199
        setAttribute("alt", alt);
1✔
200
    }
1✔
201

202
    /**
203
     * Sets the no href.
204
     *
205
     * @param noHref
206
     *            the new no href
207
     */
208
    @Override
209
    public void setNoHref(boolean noHref) {
210
        setAttribute("nohref", noHref);
1✔
211
    }
1✔
212
}
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