Class ComponentPropertyHelperUtil

java.lang.Object
com.vaadin.copilot.plugins.propertypanel.ComponentPropertyHelperUtil

public class ComponentPropertyHelperUtil extends Object
Helper util for properties panel to handle parsing and obtaining data from JSON
  • Method Details

    • getPropertyType

      public static ComponentPropertyHelperUtil.PropertyFieldInfo getPropertyType(Class<?> paramType)
      Converts object to ComponentPropertyType
      Parameters:
      paramType - Field parameter
      Returns:
      Property field info. Returns null if param is null or type is not known
    • extractPropertyValueFromJson

      public static Object extractPropertyValueFromJson(com.fasterxml.jackson.databind.JsonNode data)
      Parses JSON object to obtain Java-typed value. Compares JSON field type with ComponentPropertyType and 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.LONG then Object type is Long
      Throws:
      IllegalArgumentException - is thrown if JSON object is null or type is unknown.