Adds a {@code data-} attribute to the element.

@param name The name of the data attribute w/o the {@code data-} prefix. However it won't be added if it's
already present.
516402
public B data(String name, String value) {
        get().dataset.set(name.replaceFirst("^data-", ""), value);
        return that();
    }
868989
public function AddElement($name, $data)
    {
        $this->factory->addElement($this, $name, $data);
        return $this;
    }
325265
public void addAttribute(final String _name, final String _value) {
        this.attributes.put(_name, new XmlNode() {
            {
                this.name = _name;
                this.value = _value;
                this.valid = true;
                this.type = XmlNode.ATTRIBUTE_NODE;
            }
        });
    }
1145326
public void setAttribute(String name, String value) {
        this.myAttrs.put(name.toLowerCase(), value);
    }
533697
protected void attributeImpl(String name, String value) {
        if (! (this.xmlNode instanceof Element)) {
            throw new RuntimeException(
                "Cannot add an attribute to non-Element underlying node: "
                + this.xmlNode);
        }
        ((Element) xmlNode).setAttribute(name, value);
    }
592895
public void removeAttribute(String name) {
        if (name == null) {
            throw new NullPointerException("don't set a NULL named attribute");
        }
        synchronized (mutex) {
            window.remove(name);
            if (deleteAttributes == null) {
                deleteAttributes = new HashSet<String>(4);
                deleteAttributes.add(name);
            }
        }
    }
725543
public void addAttribute(String attributeName, String attributeValue) throws XmlModelException {
        String name = attributeName.trim();
        String value = attributeValue.trim();
        if(attributesMap.containsKey(name)) {
            throw new XmlModelException("Duplicate attribute: " + name);
        }
        attributeNames.add(name);
        attributesMap.put(name, new Attribute(name, value));
    }
407017
public Object setAttribute(String name, Object attribute)
    {
        if (_attributes==null)
            _attributes=new HashMap(11);
        return _attributes.put(name,attribute);
    }
240436
public Option add(String name) throws RequiredParametersException {
		if (!this.data.containsKey(name)) {
			Option option = new Option(name);
			this.data.put(name, option);
			return option;
		} else {
			throw new RequiredParametersException("Option with key " + name + " already exists.");
		}
	}
71709
public void setAttribute(String name, Object value) {
		this.webSocketSession.getAttributes().put(name, value);
	}
781781
public void addAttribute(String localName, String value) {
        if ("id".equals(localName)) {
            super.addAttribute("", localName, localName, "ID", value);
        } else {
            super.addAttribute("", localName, localName, "CDATA", value);
        }
    }
217788
public void setAttribute(String name, Object value) {
        createSessionIfNecessary();
        synchronized (this) {
            adaptee.setAttribute(name, value);
        }
    }
648998
function setData(element, name, data) {
  if (isObject(data)) {
    element[name] = data;
  } else if (element.dataset) {
    element.dataset[name] = data;
  } else {
    element.setAttribute('data-' + hyphenate(name), data);
  }
}
424705
function(name, attributes) {
        var el = et.Element(name);
        for (var a in attributes) {
            el.attrib[a] = attributes[a];
        }
        this.doc.getroot().append(el);
    }
1255164
private void addToCreateElements(String elementName) {
        HashMap<String, String> elementAttributes = new HashMap<>();

        elementAttributes.put(XsdAbstractElement.NAME_TAG, elementName);

        if (!createdElements.containsKey(getCleanName(elementName))){
            createdElements.put(getCleanName(elementName), new XsdElement(null, elementAttributes));
        }
    }
134250
public void putField(String name) throws IOException
    {
        VariableElement field = El.getField(subClass, name);
        if (field == null)
        {
            throw new IllegalArgumentException("field "+name+" not found");
        }
        putField(field);
    }
79694
public void setDateAttribute(String name, Date value) {
		ensureAttributes();
		Attribute attribute = new DateAttribute(value);
		attribute.setEditable(isEditable(name));
		getAllAttributes().put(name, attribute);
	}