• 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

93.55
/src/main/java/com/meterware/httpunit/dom/AttrImpl.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 org.w3c.dom.Attr;
11
import org.w3c.dom.DOMException;
12
import org.w3c.dom.Document;
13
import org.w3c.dom.Element;
14
import org.w3c.dom.Node;
15
import org.w3c.dom.TypeInfo;
16

17
/**
18
 * The Class AttrImpl.
19
 */
20
public class AttrImpl extends NodeImpl implements Attr {
1✔
21

22
    /** The Constant serialVersionUID. */
23
    private static final long serialVersionUID = 1L;
24

25
    /** The name. */
26
    private String _name;
27

28
    /** The value. */
29
    private String _value = "";
1✔
30

31
    /** The specified. */
32
    private boolean _specified = false;
1✔
33

34
    /** The owner element. */
35
    private Element _ownerElement;
36

37
    /**
38
     * Creates the attribute.
39
     *
40
     * @param owner
41
     *            the owner
42
     * @param name
43
     *            the name
44
     *
45
     * @return the attr impl
46
     */
47
    static AttrImpl createAttribute(DocumentImpl owner, String name) {
48
        AttrImpl attribute = new AttrImpl();
1✔
49
        attribute.initialize(owner, name);
1✔
50
        return attribute;
1✔
51
    }
52

53
    /**
54
     * Creates the attribute.
55
     *
56
     * @param owner
57
     *            the owner
58
     * @param namespaceURI
59
     *            the namespace URI
60
     * @param qualifiedName
61
     *            the qualified name
62
     *
63
     * @return the attr
64
     */
65
    public static Attr createAttribute(DocumentImpl owner, String namespaceURI, String qualifiedName) {
66
        AttrImpl attribute = new AttrImpl();
1✔
67
        attribute.initialize(owner, qualifiedName);
1✔
68
        return attribute;
1✔
69
    }
70

71
    /**
72
     * Initialize.
73
     *
74
     * @param owner
75
     *            the owner
76
     * @param name
77
     *            the name
78
     */
79
    protected void initialize(DocumentImpl owner, String name) {
80
        super.initialize(owner);
1✔
81
        _name = name;
1✔
82
    }
1✔
83

84
    @Override
85
    public String getNodeName() {
86
        return getName();
1✔
87
    }
88

89
    @Override
90
    public String getNodeValue() throws DOMException {
91
        return getValue();
1✔
92
    }
93

94
    @Override
95
    public void setNodeValue(String nodeValue) throws DOMException {
96
        setValue(nodeValue);
1✔
97
    }
1✔
98

99
    @Override
100
    public short getNodeType() {
101
        return ATTRIBUTE_NODE;
1✔
102
    }
103

104
    @Override
105
    public String getName() {
106
        return _name;
1✔
107
    }
108

109
    @Override
110
    public boolean getSpecified() {
111
        return _specified;
1✔
112
    }
113

114
    @Override
115
    public String getValue() {
116
        return _value;
1✔
117
    }
118

119
    @Override
120
    public void setValue(String value) throws DOMException {
121
        _value = value;
1✔
122
        _specified = true;
1✔
123
    }
1✔
124

125
    @Override
126
    public Element getOwnerElement() {
127
        return _ownerElement;
1✔
128
    }
129

130
    /**
131
     * Sets the owner element.
132
     *
133
     * @param ownerElement
134
     *            the new owner element
135
     */
136
    void setOwnerElement(Element ownerElement) {
137
        _ownerElement = ownerElement;
1✔
138
    }
1✔
139

140
    /**
141
     * Import node.
142
     *
143
     * @param document
144
     *            the document
145
     * @param attr
146
     *            the attr
147
     *
148
     * @return the node
149
     */
150
    public static Node importNode(Document document, Attr attr) {
151
        Attr attribute = document.createAttributeNS(attr.getNamespaceURI(), attr.getName());
1✔
152
        attribute.setValue(attr.getValue());
1✔
153
        return attribute;
1✔
154
    }
155

156
    // ------------------------------------- DOM level 3 methods
157
    // ------------------------------------------------------------
158

159
    @Override
160
    public TypeInfo getSchemaTypeInfo() {
161
        return null; // To change body of implemented methods use File | Settings | File Templates.
×
162
    }
163

164
    @Override
165
    public boolean isId() {
166
        return false; // To change body of implemented methods use File | Settings | File Templates.
×
167
    }
168
}
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