Package com.vaadin.copilot.javarewriter
Class FlowComponentQuirks
java.lang.Object
com.vaadin.copilot.javarewriter.FlowComponentQuirks
This class contains hacks related to Flow components and how they work.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcomponentSpecificValueMapping(Class<?> componentType, String prop, Object value) Rewrites the value of a property for a specific component type.static StringconvertReactPropertyToJavaSetter(String property, Class<?> type) Converts a React property name to a Java setter method name.static StringgetClassForTag(String tag) Returns the Java class name for a given HTML tag.static booleanisInvertedBoolean(String property, Class<?> type)
-
Method Details
-
getClassForTag
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 typeprop- the property namevalue- the property value- Returns:
- the rewritten value or the original value if no rewriting is needed
-
convertReactPropertyToJavaSetter
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 nametype- the component type- Returns:
- the Java setter method name or
nullif no mapping is found
-
isInvertedBoolean
-