Class FlowComponentDefaultValueCache
java.lang.Object
com.vaadin.copilot.plugins.propertypanel.FlowComponentDefaultValueCache
Collects and caches default values of a component by instantiating a new
instance from
Class and by calling getter methods-
Method Summary
Modifier and TypeMethodDescriptiongetDefaultPropertyValue(com.vaadin.flow.component.Component component, String propertyName) Retrieves the default value of a specified property for a given component.
-
Method Details
-
getInstance
-
getDefaultPropertyValue
public Optional<Object> getDefaultPropertyValue(com.vaadin.flow.component.Component component, String propertyName) throws IntrospectionException Retrieves the default value of a specified property for a given component.If the default values for the component's class have not been cached yet, this method invokes
collectDefaultPropertiesto compute and cache them. Then, it attempts to retrieve the default value for the specified property name from the cache.- Parameters:
component- the UI component whose property's default value is being queriedpropertyName- the name of the property to look up- Returns:
- an
Optionalcontaining the default value of the property if available, or an emptyOptionalif the property is not found - Throws:
IntrospectionException- if an error occurs while introspecting the component to collect its default properties
-