public class NodeMap extends NodeFeature implements ReactiveValue
The feature works as a reactive value with regards to the set of available
properties. A Computation will get a dependency on this feature by
iterating the properties. Accessing a property by name does not create a
dependency. The Computation is invalidated when a property is
added (properties are never removed). It is not invalidated when the value of
a property changes since the property is a reactive values of its own.
| Constructor and Description |
|---|
NodeMap(int id,
StateNode node)
Creates a new map feature.
|
| Modifier and Type | Method and Description |
|---|---|
elemental.events.EventRemover |
addPropertyAddListener(MapPropertyAddListener listener)
Adds a listener that is informed whenever a new property is added to this
map.
|
elemental.events.EventRemover |
addReactiveValueChangeListener(ReactiveValueChangeListener reactiveValueChangeListener)
Adds a listener that has a dependency to this value, and should be
notified when this value changes.
|
elemental.json.JsonValue |
convert(Function<Object,elemental.json.JsonValue> converter)
Convert the feature values into a
JsonValue using provided
converter for the values stored in the feature (i.e. |
void |
forEachProperty(JsMap.ForEachCallback<String,MapProperty> callback)
Iterates all properties in this map.
|
elemental.json.JsonValue |
getDebugJson()
Gets a JSON object representing the contents of this feature.
|
MapProperty |
getProperty(String name)
Gets the property with a given name, creating it if necessary.
|
JsArray<String> |
getPropertyNames()
Gets all property names in this map.
|
boolean |
hasPropertyValue(String name)
Checks if the given property is present and has a value.
|
getAsDebugJson, getId, getNodepublic NodeMap(int id,
StateNode node)
id - the id of the featurenode - the node of the featurepublic MapProperty getProperty(String name)
A MapPropertyAddEvent is fired if a new property instance is
created.
name - the name of the propertypublic boolean hasPropertyValue(String name)
name - the name of the property to checkpublic void forEachProperty(JsMap.ForEachCallback<String,MapProperty> callback)
callback - the callback to invoke for each propertypublic JsArray<String> getPropertyNames()
nullpublic elemental.json.JsonValue getDebugJson()
NodeFeaturegetDebugJson in class NodeFeaturepublic elemental.json.JsonValue convert(Function<Object,elemental.json.JsonValue> converter)
NodeFeatureJsonValue using provided
converter for the values stored in the feature (i.e. primitive
types, StateNodes).convert in class NodeFeatureconverter - converter to convert values stored in the featurepublic elemental.events.EventRemover addReactiveValueChangeListener(ReactiveValueChangeListener reactiveValueChangeListener)
ReactiveValueaddReactiveValueChangeListener in interface ReactiveValuereactiveValueChangeListener - the listener to addpublic elemental.events.EventRemover addPropertyAddListener(MapPropertyAddListener listener)
listener - the property add listenerCopyright © 2000–2022 Vaadin Ltd. All rights reserved.