MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / DomElement

Method DomElement

src/main/java/org/htmlunit/html/DomElement.java:129–152  ·  view source on GitHub ↗

Creates an instance of a DOM element that can have a namespace. @param namespaceURI the URI that identifies an XML namespace @param qualifiedName the qualified name of the element type to instantiate @param page the page that contains this element @param attributes a map ready initialized with the

(final String namespaceURI, final String qualifiedName, final SgmlPage page,
            final Map<String, DomAttr> attributes)

Source from the content-addressed store, hash-verified

127 * {@code null}. The map will be stored as is, not copied.
128 */
129 public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page,
130 final Map<String, DomAttr> attributes) {
131 super(namespaceURI, qualifiedName, page);
132
133 if (attributes == null) {
134 attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive());
135 }
136 else {
137 attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes);
138
139 for (final DomAttr entry : attributes.values()) {
140 entry.setParentNode(this);
141 final String attrNamespaceURI = entry.getNamespaceURI();
142 final String prefix = entry.getPrefix();
143
144 if (attrNamespaceURI != null && prefix != null) {
145 if (namespaces_ == null) {
146 namespaces_ = new FastHashMap<>(1, 0.5f);
147 }
148 namespaces_.put(attrNamespaceURI, prefix);
149 }
150 }
151 }
152 }
153
154 /**
155 * {@inheritDoc}

Callers

nothing calls this directly

Calls 6

setParentNodeMethod · 0.80
valuesMethod · 0.45
getNamespaceURIMethod · 0.45
getPrefixMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected