• 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

93.55
/src/main/java/com/meterware/httpunit/dom/AttrImpl.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 org.w3c.dom.Attr;
23
import org.w3c.dom.DOMException;
24
import org.w3c.dom.Document;
25
import org.w3c.dom.Element;
26
import org.w3c.dom.Node;
27
import org.w3c.dom.TypeInfo;
28

29
/**
30
 * The Class AttrImpl.
31
 */
32
public class AttrImpl extends NodeImpl implements Attr {
1✔
33

34
    /** The Constant serialVersionUID. */
35
    private static final long serialVersionUID = 1L;
36

37
    /** The name. */
38
    private String _name;
39

40
    /** The value. */
41
    private String _value = "";
1✔
42

43
    /** The specified. */
44
    private boolean _specified = false;
1✔
45

46
    /** The owner element. */
47
    private Element _ownerElement;
48

49
    /**
50
     * Creates the attribute.
51
     *
52
     * @param owner
53
     *            the owner
54
     * @param name
55
     *            the name
56
     *
57
     * @return the attr impl
58
     */
59
    static AttrImpl createAttribute(DocumentImpl owner, String name) {
60
        AttrImpl attribute = new AttrImpl();
1✔
61
        attribute.initialize(owner, name);
1✔
62
        return attribute;
1✔
63
    }
64

65
    /**
66
     * Creates the attribute.
67
     *
68
     * @param owner
69
     *            the owner
70
     * @param namespaceURI
71
     *            the namespace URI
72
     * @param qualifiedName
73
     *            the qualified name
74
     *
75
     * @return the attr
76
     */
77
    public static Attr createAttribute(DocumentImpl owner, String namespaceURI, String qualifiedName) {
78
        AttrImpl attribute = new AttrImpl();
1✔
79
        attribute.initialize(owner, qualifiedName);
1✔
80
        return attribute;
1✔
81
    }
82

83
    /**
84
     * Initialize.
85
     *
86
     * @param owner
87
     *            the owner
88
     * @param name
89
     *            the name
90
     */
91
    protected void initialize(DocumentImpl owner, String name) {
92
        super.initialize(owner);
1✔
93
        _name = name;
1✔
94
    }
1✔
95

96
    @Override
97
    public String getNodeName() {
98
        return getName();
1✔
99
    }
100

101
    @Override
102
    public String getNodeValue() throws DOMException {
103
        return getValue();
1✔
104
    }
105

106
    @Override
107
    public void setNodeValue(String nodeValue) throws DOMException {
108
        setValue(nodeValue);
1✔
109
    }
1✔
110

111
    @Override
112
    public short getNodeType() {
113
        return ATTRIBUTE_NODE;
1✔
114
    }
115

116
    @Override
117
    public String getName() {
118
        return _name;
1✔
119
    }
120

121
    @Override
122
    public boolean getSpecified() {
123
        return _specified;
1✔
124
    }
125

126
    @Override
127
    public String getValue() {
128
        return _value;
1✔
129
    }
130

131
    @Override
132
    public void setValue(String value) throws DOMException {
133
        _value = value;
1✔
134
        _specified = true;
1✔
135
    }
1✔
136

137
    @Override
138
    public Element getOwnerElement() {
139
        return _ownerElement;
1✔
140
    }
141

142
    /**
143
     * Sets the owner element.
144
     *
145
     * @param ownerElement
146
     *            the new owner element
147
     */
148
    void setOwnerElement(Element ownerElement) {
149
        _ownerElement = ownerElement;
1✔
150
    }
1✔
151

152
    /**
153
     * Import node.
154
     *
155
     * @param document
156
     *            the document
157
     * @param attr
158
     *            the attr
159
     *
160
     * @return the node
161
     */
162
    public static Node importNode(Document document, Attr attr) {
163
        Attr attribute = document.createAttributeNS(attr.getNamespaceURI(), attr.getName());
1✔
164
        attribute.setValue(attr.getValue());
1✔
165
        return attribute;
1✔
166
    }
167

168
    // ------------------------------------- DOM level 3 methods
169
    // ------------------------------------------------------------
170

171
    @Override
172
    public TypeInfo getSchemaTypeInfo() {
173
        return null; // To change body of implemented methods use File | Settings | File Templates.
×
174
    }
175

176
    @Override
177
    public boolean isId() {
178
        return false; // To change body of implemented methods use File | Settings | File Templates.
×
179
    }
180
}
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