Class ComponentPropertyHelperUtil
java.lang.Object
com.vaadin.copilot.plugins.propertypanel.ComponentPropertyHelperUtil
Helper util for properties panel to handle parsing and obtaining data from
JSON
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHolds metadata about a component property field, including its type, whether it supports multiple selection, and the fully qualified name of its associated class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectextractPropertyValueFromJson(com.fasterxml.jackson.databind.JsonNode data) Parses JSON object to obtain Java-typed value.getPropertyType(Class<?> paramType) Converts object toComponentPropertyType
-
Method Details
-
getPropertyType
Converts object toComponentPropertyType- Parameters:
paramType- Field parameter- Returns:
- Property field info. Returns null if param is null or type is not known
-
extractPropertyValueFromJson
Parses JSON object to obtain Java-typed value. Compares JSON field type withComponentPropertyTypeand returns the value within that type.- Parameters:
data- data is sent from Properties Panel- Returns:
- Object that represents the value. e.g. If json has
ComponentPropertyType.LONGthen Object type is Long - Throws:
IllegalArgumentException- is thrown if JSON object is null or type is unknown.
-