com.vaadin.copilot.javarewriter.
Record Class ComponentInfo
-
Constructor Summary
ConstructorsConstructorDescriptionComponentInfo
(Class<? extends Component> type, com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr, com.github.javaparser.ast.stmt.BlockStmt componentCreateScope, AttachExpression attachCall, Optional<com.github.javaparser.ast.stmt.BlockStmt> componentAttachScope, com.github.javaparser.ast.body.VariableDeclarator localVariableDeclarator, com.github.javaparser.ast.expr.AssignExpr assignmentExpression, com.github.javaparser.ast.body.FieldDeclaration fieldDeclaration, com.github.javaparser.ast.body.FieldDeclaration fieldDeclarationAndAssignment, String localVariableName, String fieldName, com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor, boolean containerComposite, boolean isAnonymousComponent, boolean isReturnValue, JavaRewriter rewriter) Creates an instance of a
ComponentInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.javaparser.ast.expr.AssignExpr
Returns the value of the
assignmentExpression
record component.Returns the value of the
attachCall
record component.Optional<com.github.javaparser.ast.stmt.BlockStmt>
Returns the value of the
componentAttachScope
record component.com.github.javaparser.ast.stmt.BlockStmt
Returns the value of the
componentCreateScope
record component.boolean
Returns the value of the
containerComposite
record component.final boolean
Indicates whether some other object is "equal to" this one.
com.github.javaparser.ast.body.FieldDeclaration
Returns the value of the
fieldDeclaration
record component.com.github.javaparser.ast.body.FieldDeclaration
Returns the value of the
fieldDeclarationAndAssignment
record component.Returns the value of the
fieldName
record component.static ComponentInfo
find
(ComponentTypeAndSourceLocation typeAndSourceLocation, JavaRewriter javaRewriter) Creates ComponentInfo of the given component.
com.github.javaparser.ast.body.VariableDeclarator
Gets the variable declarator of the component, either for the local variable or field.
final int
hashCode()
Returns a hash code value for this object.
boolean
Returns the value of the
isAnonymousComponent
record component.boolean
Returns the value of the
isReturnValue
record component.com.github.javaparser.ast.body.VariableDeclarator
Returns the value of the
localVariableDeclarator
record component.Returns the value of the
localVariableName
record component.com.github.javaparser.ast.expr.ObjectCreationExpr
Returns the value of the
objectCreationExpr
record component.rewriter()
Returns the value of the
rewriter
record component.com.github.javaparser.ast.body.ConstructorDeclaration
Returns the value of the
routeConstructor
record component.final String
toString()
Returns a string representation of this record class.
type()
Returns the value of the
type
record component.
-
Constructor Details
-
ComponentInfo
public ComponentInfo(Class<? extends Component> type, com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr, com.github.javaparser.ast.stmt.BlockStmt componentCreateScope, AttachExpression attachCall, Optional<com.github.javaparser.ast.stmt.BlockStmt> componentAttachScope, com.github.javaparser.ast.body.VariableDeclarator localVariableDeclarator, com.github.javaparser.ast.expr.AssignExpr assignmentExpression, com.github.javaparser.ast.body.FieldDeclaration fieldDeclaration, com.github.javaparser.ast.body.FieldDeclaration fieldDeclarationAndAssignment, String localVariableName, String fieldName, com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor, boolean containerComposite, boolean isAnonymousComponent, boolean isReturnValue, JavaRewriter rewriter) Creates an instance of a
ComponentInfo
record class.Parameters:
type
- the value for thetype
record componentobjectCreationExpr
- the value for theobjectCreationExpr
record componentcomponentCreateScope
- the value for thecomponentCreateScope
record componentattachCall
- the value for theattachCall
record componentcomponentAttachScope
- the value for thecomponentAttachScope
record componentlocalVariableDeclarator
- the value for thelocalVariableDeclarator
record componentassignmentExpression
- the value for theassignmentExpression
record componentfieldDeclaration
- the value for thefieldDeclaration
record componentfieldDeclarationAndAssignment
- the value for thefieldDeclarationAndAssignment
record componentlocalVariableName
- the value for thelocalVariableName
record componentfieldName
- the value for thefieldName
record componentrouteConstructor
- the value for therouteConstructor
record componentcontainerComposite
- the value for thecontainerComposite
record componentisAnonymousComponent
- the value for theisAnonymousComponent
record componentisReturnValue
- the value for theisReturnValue
record componentrewriter
- the value for therewriter
record component
-
-
Method Details
-
find
public static ComponentInfo find(ComponentTypeAndSourceLocation typeAndSourceLocation, JavaRewriter javaRewriter) Creates ComponentInfo of the given component.
Parameters:
typeAndSourceLocation
- Type and source location of a componentjavaRewriter
- JavaRewriter class of the given component.Returns:
Component info if every argument is found well. Throws
IllegalArgumentException
for unknown statements. -
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
-
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 with
Objects::equals(Object,Object)
; primitive components are compared with '=='. -
type
Returns the value of the
type
record component.Returns:
the value of the
type
record component -
objectCreationExpr
public com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr()Returns the value of the
objectCreationExpr
record component.Returns:
the value of the
objectCreationExpr
record component -
componentCreateScope
public com.github.javaparser.ast.stmt.BlockStmt componentCreateScope()Returns the value of the
componentCreateScope
record component.Returns:
the value of the
componentCreateScope
record component -
attachCall
Returns the value of the
attachCall
record component.Returns:
the value of the
attachCall
record component -
componentAttachScope
Returns the value of the
componentAttachScope
record component.Returns:
the value of the
componentAttachScope
record component -
localVariableDeclarator
public com.github.javaparser.ast.body.VariableDeclarator localVariableDeclarator()Returns the value of the
localVariableDeclarator
record component.Returns:
the value of the
localVariableDeclarator
record component -
assignmentExpression
public com.github.javaparser.ast.expr.AssignExpr assignmentExpression()Returns the value of the
assignmentExpression
record component.Returns:
the value of the
assignmentExpression
record component -
fieldDeclaration
public com.github.javaparser.ast.body.FieldDeclaration fieldDeclaration()Returns the value of the
fieldDeclaration
record component.Returns:
the value of the
fieldDeclaration
record component -
fieldDeclarationAndAssignment
public com.github.javaparser.ast.body.FieldDeclaration fieldDeclarationAndAssignment()Returns the value of the
fieldDeclarationAndAssignment
record component.Returns:
the value of the
fieldDeclarationAndAssignment
record component -
localVariableName
Returns the value of the
localVariableName
record component.Returns:
the value of the
localVariableName
record component -
fieldName
Returns the value of the
fieldName
record component.Returns:
the value of the
fieldName
record component -
routeConstructor
public com.github.javaparser.ast.body.ConstructorDeclaration routeConstructor()Returns the value of the
routeConstructor
record component.Returns:
the value of the
routeConstructor
record component -
containerComposite
public boolean containerComposite()Returns the value of the
containerComposite
record component.Returns:
the value of the
containerComposite
record component -
isAnonymousComponent
public boolean isAnonymousComponent()Returns the value of the
isAnonymousComponent
record component.Returns:
the value of the
isAnonymousComponent
record component -
isReturnValue
public boolean isReturnValue()Returns the value of the
isReturnValue
record component.Returns:
the value of the
isReturnValue
record component -
rewriter
Returns the value of the
rewriter
record component.Returns:
the value of the
rewriter
record component
-