Class FlowComponentQuirks

java.lang.Object
com.vaadin.copilot.javarewriter.FlowComponentQuirks

public final class FlowComponentQuirks extends Object
This class contains hacks related to Flow components and how they work.
  • Method Details

    • getClassForTag

      public static String getClassForTag(String tag)
      Returns the Java class name for a given HTML tag.
      Parameters:
      tag - the HTML tag
      Returns:
      the Java class name
    • componentSpecificValueMapping

      public static Object componentSpecificValueMapping(Class<?> componentType, String prop, Object value)
      Rewrites the value of a property for a specific component type.
      Parameters:
      componentType - the component type
      prop - the property name
      value - the property value
      Returns:
      the rewritten value or the original value if no rewriting is needed
    • convertReactPropertyToJavaSetter

      public static String convertReactPropertyToJavaSetter(String property, Class<?> type)
      Converts a React property name to a Java setter method name.

      Used to map React properties to Java setters when the react property API does not match the Java API.

      Parameters:
      property - the property name
      type - the component type
      Returns:
      the Java setter method name or null if no mapping is found
    • isInvertedBoolean

      public static boolean isInvertedBoolean(String property, Class<?> type)
    • childrenGeneratesData

      public static boolean childrenGeneratesData(JavaComponent parent, JavaComponent child)
      Returns true if child is not a component but an item that is used in DataProvider.
      Parameters:
      parent - Parent component
      child - Child definition
      Returns:
      true if it is, false otherwise.
    • hasSetItemsProps

      public static boolean hasSetItemsProps(JavaComponent component)
      Checks the given component has items property and supported.
      Parameters:
      component - component which has tag and props.
      Returns:
      true if component tag is listed in supported list and has items property, false otherwise.
    • skipProps

      public static boolean skipProps(JavaComponent component, String propKey)