com.vaadin.flow.component.
Interface PropertyDescriptor<S,G>
Type Parameters:
S
- the type used when setting the property value
G
- the type used when getting the property value, this is typically
either S
or Optional<S>
All Superinterfaces:
Describes a component property that has its value stored in some form in the component's element, typically an element property or attribute. The descriptor encapsulates details like default value handling and how to return an optional value so that those settings wouldn't have to be spread out among individual setter and getter implementations in the component's API.
Use the factory methods in PropertyDescriptors
to create property
descriptor instances.
Since:
1.0
Author:
Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault G
get
(HasElement hasElement) Gets the property value for the given component.
Gets the property value for the given element.
Gets the name of the property.
default void
set
(HasElement hasElement, S value) Sets the property value for the given component.
void
Sets the property value for the given element.
-
Method Details
-
set
Sets the property value for the given component.
Parameters:
hasElement
- the component for which to set the value, notnull
value
- the property value to set -
set
Sets the property value for the given element.
Parameters:
element
- the element for which to set the value, notnull
value
- the property value to set -
get
Gets the property value for the given component.
Parameters:
hasElement
- the component for which to get the value, notnull
Returns:
the property value
-
get
Gets the property value for the given element.
Parameters:
element
- the element for which to get the value, notnull
Returns:
the property value
-
getPropertyName
String getPropertyName()Gets the name of the property.
Returns:
the property name
-