Package com.vaadin.copilot.javarewriter
Class JavaCopySource
java.lang.Object
com.vaadin.copilot.javarewriter.JavaCopySource
- All Implemented Interfaces:
CopySource
What a Java file says about a component being copied.
The behaviour copy has always had, moved behind CopySource so the
same assembly serves another language. Nothing here changed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe resolved info, which the Java path also reports for diagnostics.itemType()The bean type, where the component is a Grid and the source says what it is.booleansetsProperty(String propertyKey) Whether the file actually sets this property.
-
Constructor Details
-
JavaCopySource
-
-
Method Details
-
componentInfo
The resolved info, which the Java path also reports for diagnostics. -
setsProperty
Description copied from interface:CopySourceWhether the file actually sets this property.A live component reports a value for
minandmaxwhether or not anyone set them, so a copy would carry defaults the original never had and paste them as explicit calls.- Specified by:
setsPropertyin interfaceCopySource- Parameters:
propertyKey- the JavaBean property name- Returns:
- true if the source sets it
-
localVariableName
- Specified by:
localVariableNamein interfaceCopySource- Returns:
- the local variable the component is assigned to, if it is one
-
fieldVariableName
- Specified by:
fieldVariableNamein interfaceCopySource- Returns:
- the field the component is assigned to, if it is one
-
itemType
The bean type, where the component is a Grid and the source says what it is.Empty rather than fatal when it cannot be read.
var grid = new Grid<>(Person.class)and a rawGrid grid = new Grid<>()both throw, and the caller'scatchthen discarded the whole metadata — so the paste lost the variable names and the original class as well, over a bean type. Raised in review of #9869.- Specified by:
itemTypein interfaceCopySource- Returns:
- the class name, or empty where the language cannot resolve it
-