Package com.vaadin.copilot.javarewriter
Record Class ComponentInfo
java.lang.Object
java.lang.Record
com.vaadin.copilot.javarewriter.ComponentInfo
- Record Components:
type- theClasstype of the componentrouteConstructor- theConstructorDeclarationassociated with the component's creationcontainerComposite-trueif the component is a container compositeisAnonymousComponent-trueif the component is an anonymous classisReturnValue-trueif the component is the return value of a methodcreatedInLoop-trueif the component is created inside a loopcustomComponentInfo- optional metadata about custom componentscomponentCreateInfoOptional- optional metadata about the component's creation processcomponentAttachInfoOptional- optional metadata about the component's attachment lifecycle
public record ComponentInfo(Class<? extends com.vaadin.flow.component.Component> type, com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor, boolean containerComposite, boolean isAnonymousComponent, boolean isReturnValue, boolean createdInLoop, boolean createAndAttachLocationsAreInSameFile, Optional<CustomComponent> customComponentInfo, Optional<ComponentCreateInfo> componentCreateInfoOptional, Optional<ComponentAttachInfo> componentAttachInfoOptional)
extends Record
Represents metadata information about a Vaadin
Component.
This record aggregates various details about a component's structure, creation, and attachment lifecycle, including information about whether it is a container composite, anonymous, a return value from a method, created inside a loop, and associated custom metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentInfo(Class<? extends com.vaadin.flow.component.Component> type, com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor, boolean containerComposite, boolean isAnonymousComponent, boolean isReturnValue, boolean createdInLoop, boolean createAndAttachLocationsAreInSameFile, Optional<CustomComponent> customComponentInfo, Optional<ComponentCreateInfo> componentCreateInfoOptional, Optional<ComponentAttachInfo> componentAttachInfoOptional) Creates an instance of aComponentInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentAttachInfoOptionalrecord component.Returns the value of thecomponentCreateInfoOptionalrecord component.booleanReturns the value of thecontainerCompositerecord component.booleanReturns the value of thecreateAndAttachLocationsAreInSameFilerecord component.booleanReturns the value of thecreatedInLooprecord component.Returns the value of thecustomComponentInforecord component.final booleanIndicates whether some other object is "equal to" this one.com.github.javaparser.ast.CompilationUnitOptional<com.github.javaparser.ast.stmt.BlockStmt> com.github.javaparser.ast.CompilationUnitcom.github.javaparser.ast.body.VariableDeclaratorGets the variable declarator of the component, either for the local variable or field.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisAnonymousComponentrecord component.booleanReturns the value of theisReturnValuerecord component.com.github.javaparser.ast.body.ConstructorDeclarationReturns the value of therouteConstructorrecord component.final StringtoString()Returns a string representation of this record class.Class<? extends com.vaadin.flow.component.Component> type()Returns the value of thetyperecord component.
-
Constructor Details
-
ComponentInfo
public ComponentInfo(Class<? extends com.vaadin.flow.component.Component> type, com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor, boolean containerComposite, boolean isAnonymousComponent, boolean isReturnValue, boolean createdInLoop, boolean createAndAttachLocationsAreInSameFile, Optional<CustomComponent> customComponentInfo, Optional<ComponentCreateInfo> componentCreateInfoOptional, Optional<ComponentAttachInfo> componentAttachInfoOptional) Creates an instance of aComponentInforecord class.- Parameters:
type- the value for thetyperecord componentrouteConstructor- the value for therouteConstructorrecord componentcontainerComposite- the value for thecontainerCompositerecord componentisAnonymousComponent- the value for theisAnonymousComponentrecord componentisReturnValue- the value for theisReturnValuerecord componentcreatedInLoop- the value for thecreatedInLooprecord componentcreateAndAttachLocationsAreInSameFile- the value for thecreateAndAttachLocationsAreInSameFilerecord componentcustomComponentInfo- the value for thecustomComponentInforecord componentcomponentCreateInfoOptional- the value for thecomponentCreateInfoOptionalrecord componentcomponentAttachInfoOptional- the value for thecomponentAttachInfoOptionalrecord component
-
-
Method Details
-
getAttachCallInSameFileOrThrow
-
getComponentAttachScopeOrThrowIfDifferentFile
public Optional<com.github.javaparser.ast.stmt.BlockStmt> getComponentAttachScopeOrThrowIfDifferentFile() -
getCreateInfoOrThrow
-
getCreateLocationFileOrThrowIfNull
-
getCreateLocationCompilationUnitOrThrowIfNull
public com.github.javaparser.ast.CompilationUnit getCreateLocationCompilationUnitOrThrowIfNull() -
getAttachLocationCompilationUnitOrThrowIfNull
public com.github.javaparser.ast.CompilationUnit getAttachLocationCompilationUnitOrThrowIfNull() -
getVariableDeclarator
public com.github.javaparser.ast.body.VariableDeclarator getVariableDeclarator()Gets the variable declarator of the component, either for the local variable or field.- Returns:
- the variable declarator of the component, or null if not found
-
typeWithGenerics
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
routeConstructor
public com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor()Returns the value of therouteConstructorrecord component.- Returns:
- the value of the
routeConstructorrecord component
-
containerComposite
public boolean containerComposite()Returns the value of thecontainerCompositerecord component.- Returns:
- the value of the
containerCompositerecord component
-
isAnonymousComponent
public boolean isAnonymousComponent()Returns the value of theisAnonymousComponentrecord component.- Returns:
- the value of the
isAnonymousComponentrecord component
-
isReturnValue
public boolean isReturnValue()Returns the value of theisReturnValuerecord component.- Returns:
- the value of the
isReturnValuerecord component
-
createdInLoop
public boolean createdInLoop()Returns the value of thecreatedInLooprecord component.- Returns:
- the value of the
createdInLooprecord component
-
createAndAttachLocationsAreInSameFile
public boolean createAndAttachLocationsAreInSameFile()Returns the value of thecreateAndAttachLocationsAreInSameFilerecord component.- Returns:
- the value of the
createAndAttachLocationsAreInSameFilerecord component
-
customComponentInfo
Returns the value of thecustomComponentInforecord component.- Returns:
- the value of the
customComponentInforecord component
-
componentCreateInfoOptional
Returns the value of thecomponentCreateInfoOptionalrecord component.- Returns:
- the value of the
componentCreateInfoOptionalrecord component
-
componentAttachInfoOptional
Returns the value of thecomponentAttachInfoOptionalrecord component.- Returns:
- the value of the
componentAttachInfoOptionalrecord component
-