Class ElementAttributeMap
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeature
-
- com.vaadin.flow.internal.nodefeature.NodeMap
-
- com.vaadin.flow.internal.nodefeature.ElementAttributeMap
-
- All Implemented Interfaces:
Serializable
public class ElementAttributeMap extends NodeMap
Map for element attribute values.For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ElementAttributeMap(StateNode node)Creates a new element attribute map for the given node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<String>attributes()Gets the attribute names.Stringget(String attribute)Gets the value of an attribute.booleanhas(String attribute)Checks whether an attribute with the given name has been set.Serializableremove(String attribute)Removes the named attribute.voidset(String attribute, String value)Sets the given attribute to the given value.voidsetResource(String attribute, AbstractStreamResource resource)Sets the given attribute to the givenStreamResourcevalue.-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeMap
clear, collectChanges, contains, forEachChild, generateChangesFromEmpty, getOrDefault, getOrDefault, getOrDefault, keySet, mayUpdateFromClient, producePutChange, put, put, updateFromClient
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
-
-
-
Constructor Detail
-
ElementAttributeMap
public ElementAttributeMap(StateNode node)
Creates a new element attribute map for the given node.- Parameters:
node- the node that the map belongs to
-
-
Method Detail
-
set
public void set(String attribute, String value)
Sets the given attribute to the given value.- Parameters:
attribute- the attribute namevalue- the value
-
has
public boolean has(String attribute)
Checks whether an attribute with the given name has been set.- Parameters:
attribute- the name of the attribute- Returns:
trueif there is a property with the given name;falseif there is no property
-
remove
public Serializable remove(String attribute)
Removes the named attribute.
-
attributes
public Stream<String> attributes()
Gets the attribute names.- Returns:
- a stream of all the attribute names which have been set
-
setResource
public void setResource(String attribute, AbstractStreamResource resource)
Sets the given attribute to the givenStreamResourcevalue.- Parameters:
attribute- the attribute nameresource- the value
-
-