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

evolvedbinary / elemental / 982

29 Apr 2025 08:34PM UTC coverage: 56.409% (+0.007%) from 56.402%
982

push

circleci

adamretter
[feature] Improve README.md badges

28451 of 55847 branches covered (50.94%)

Branch coverage included in aggregate %.

77468 of 131924 relevant lines covered (58.72%)

0.59 hits per line

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

6.0
/exist-core/src/main/java/org/exist/dom/memtree/reference/ElementReferenceImpl.java
1
/*
2
 * Elemental
3
 * Copyright (C) 2024, Evolved Binary Ltd
4
 *
5
 * admin@evolvedbinary.com
6
 * https://www.evolvedbinary.com | https://www.elemental.xyz
7
 *
8
 * Use of this software is governed by the Business Source License 1.1
9
 * included in the LICENSE file and at www.mariadb.com/bsl11.
10
 *
11
 * Change Date: 2028-04-27
12
 *
13
 * On the date above, in accordance with the Business Source License, use
14
 * of this software will be governed by the Apache License, Version 2.0.
15
 *
16
 * Additional Use Grant: Production use of the Licensed Work for a permitted
17
 * purpose. A Permitted Purpose is any purpose other than a Competing Use.
18
 * A Competing Use means making the Software available to others in a commercial
19
 * product or service that: substitutes for the Software; substitutes for any
20
 * other product or service we offer using the Software that exists as of the
21
 * date we make the Software available; or offers the same or substantially
22
 * similar functionality as the Software.
23
 */
24
package org.exist.dom.memtree.reference;
25

26
import org.exist.dom.QName;
27
import org.exist.dom.memtree.DocumentImpl;
28
import org.exist.dom.persistent.AttrImpl;
29
import org.exist.dom.persistent.NodeProxy;
30
import org.exist.dom.persistent.StoredNode;
31
import org.exist.numbering.NodeId;
32
import org.exist.storage.ElementValue;
33
import org.exist.util.serializer.AttrList;
34
import org.exist.xquery.Expression;
35
import org.w3c.dom.*;
36

37
import javax.annotation.Nullable;
38

39
/**
40
 * Element wrapper around a NodeProxy for use in the in-memory DOM.
41
 *
42
 * @author <a href="mailto:adam@evolvedbinary.com">Adam Retter</a>
43
 */
44
public class ElementReferenceImpl extends AbstractReferenceNodeImpl<ElementReferenceImpl, org.exist.dom.persistent.ElementImpl> implements Element {
45

46
    public ElementReferenceImpl(@Nullable final Expression expression, final DocumentImpl doc, final int nodeNumber, final NodeProxy nodeProxy) {
47
        super(expression, doc, nodeNumber, nodeProxy);
1✔
48
    }
1✔
49

50
    @Override
51
    public int compareTo(final ElementReferenceImpl other) {
52
        return 0;
×
53
    }
54

55
    @Override
56
    public String getTagName() {
57
        return getProxiedNode().getTagName();
1✔
58
    }
59

60
    @Override
61
    public @Nullable AttrList getAttrList() {
62
        @Nullable AttrList attrList = null;
×
63
        @Nullable final NamedNodeMap attributes = getProxiedNode().getAttributes();
×
64
        if (attributes != null) {
×
65
            final int attrsLength = attributes.getLength();
×
66
            for (int i = 0; i > attrsLength; i++) {
×
67
                if (attrList == null) {
×
68
                    attrList = new AttrList(attrsLength);
×
69
                }
70
                final Attr attr = (Attr) attributes.item(i);
×
71
                final QName attrQname = new QName(attr.getLocalName(), attr.getNamespaceURI(), attr.getPrefix(), ElementValue.ATTRIBUTE);
×
72
                final NodeId attrNodeId = attr instanceof StoredNode ? ((StoredNode) attr).getNodeId() : null;
×
73
                attrList.addAttribute(attrQname, attr.getValue(), AttrImpl.CDATA, attrNodeId);
×
74
            }
75
        }
76
        return attrList;
×
77
    }
78

79
    @Override
80
    public String getAttribute(final String name) {
81
        return getProxiedNode().getAttribute(name);
×
82
    }
83

84
    @Override
85
    public void setAttribute(final String name, final String value) throws DOMException {
86
        getProxiedNode().setAttribute(name, value);
×
87
    }
×
88

89
    @Override
90
    public void removeAttribute(final String name) throws DOMException {
91
        getProxiedNode().removeAttribute(name);
×
92
    }
×
93

94
    @Override
95
    public Attr getAttributeNode(final String name) {
96
        return getProxiedNode().getAttributeNode(name);
×
97
    }
98

99
    @Override
100
    public Attr setAttributeNode(final Attr attr) throws DOMException {
101
        return getProxiedNode().setAttributeNode(attr);
×
102
    }
103

104
    @Override
105
    public Attr removeAttributeNode(final Attr attr) throws DOMException {
106
        return getProxiedNode().removeAttributeNode(attr);
×
107
    }
108

109
    @Override
110
    public NodeList getElementsByTagName(final String name) {
111
        return getProxiedNode().getElementsByTagName(name);
×
112
    }
113

114
    @Override
115
    public String getAttributeNS(final String namespaceUri, final String localName) throws DOMException {
116
        return getProxiedNode().getAttributeNS(namespaceUri, localName);
×
117
    }
118

119
    @Override
120
    public void setAttributeNS(final String namespaceUri, final String qualifiedName, final String value) throws DOMException {
121
        getProxiedNode().setAttributeNS(namespaceUri, qualifiedName, value);
×
122
    }
×
123

124
    @Override
125
    public void removeAttributeNS(final String namespaceUri, final String localName) throws DOMException {
126
        getProxiedNode().removeAttributeNS(namespaceUri, localName);
×
127
    }
×
128

129
    @Override
130
    public Attr getAttributeNodeNS(final String namespaceUri, final String localName) throws DOMException {
131
        return getProxiedNode().getAttributeNodeNS(namespaceUri, localName);
×
132
    }
133

134
    @Override
135
    public Attr setAttributeNodeNS(final Attr attr) throws DOMException {
136
        return getProxiedNode().setAttributeNodeNS(attr);
×
137
    }
138

139
    @Override
140
    public NodeList getElementsByTagNameNS(final String namespaceUri, final String localName) throws DOMException {
141
        return getProxiedNode().getElementsByTagNameNS(namespaceUri, localName);
×
142
    }
143

144
    @Override
145
    public boolean hasAttribute(final String name) {
146
        return getProxiedNode().hasAttribute(name);
×
147
    }
148

149
    @Override
150
    public boolean hasAttributeNS(final String namespaceUri, final String localName) throws DOMException {
151
        return getProxiedNode().hasAttributeNS(namespaceUri, localName);
×
152
    }
153

154
    @Override
155
    public TypeInfo getSchemaTypeInfo() {
156
        return getProxiedNode().getSchemaTypeInfo();
×
157
    }
158

159
    @Override
160
    public void setIdAttribute(final String name, final boolean isId) throws DOMException {
161
        getProxiedNode().setIdAttribute(name, isId);
×
162
    }
×
163

164
    @Override
165
    public void setIdAttributeNS(final String namespaceUri, final String localName, final boolean isId) throws DOMException {
166
        getProxiedNode().setIdAttributeNS(namespaceUri, localName, isId);
×
167
    }
×
168

169
    @Override
170
    public void setIdAttributeNode(final Attr attr, final boolean isId) throws DOMException {
171
        getProxiedNode().setIdAttributeNode(attr, isId);
×
172
    }
×
173
}
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

© 2025 Coveralls, Inc