Package org.codehaus.groovy.classgen
Class ClassCompletionVerifier
java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.classgen.ClassCompletionVerifier
- All Implemented Interfaces:
GroovyClassVisitor,GroovyCodeVisitor,ErrorCollecting
Checks that a class satisfies various conditions including:
- Incorrect class or method access modifiers
- No abstract methods appear in a non-abstract class
- Existence and correct visibility for inherited members
- Invalid attempts to override final members
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SourceUnitProvides access to theSourceUnitfor error reporting during visitation.voidvisitBinaryExpression(BinaryExpression expression) Visits aBinaryExpression, traversing left and right operand expressions.voidVisits aCatchStatement, processing variable annotations and invoking the statement hook.voidvisitClass(ClassNode node) Visits aClassNode, processing its annotations, package, imports, contents, and object initializers.voidvisitConstantExpression(ConstantExpression expression) Visits aConstantExpression.voidVisits aConstructorNode, processing its annotations, parameter annotations, and code block.voidvisitDeclarationExpression(DeclarationExpression expression) Visits aDeclarationExpressionwith annotation processing, traversing expression annotations before delegating to parent traversal.voidvisitField(FieldNode node) Visits aFieldNode, processing its annotations and initial value expression if present.voidVisits aForStatement, invoking statement hooks and processing loop variable annotations.voidvisitGStringExpression(GStringExpression expression) Visits aGStringExpression, traversing string parts and interpolated value expressions.voidvisitMethod(MethodNode node) Visits aMethodNode, processing its annotations, parameter annotations, and code block.voidVisits aMethodCallExpression, traversing the object expression, method expression, and argument list.voidvisitProperty(PropertyNode node) Visits aPropertyNode, processing its annotations, initial value expression, and getter/setter blocks if present.Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitClassCodeContainer, visitClosureExpression, visitConstructorOrMethod, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitIfElse, visitImports, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, visitStatementAnnotations, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoopMethods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpressionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor
visit, visit, visitEmptyExpression, visitListOfExpressions
-
Constructor Details
-
ClassCompletionVerifier
-
-
Method Details
-
getSourceUnit
Description copied from class:ClassCodeVisitorSupportProvides access to theSourceUnitfor error reporting during visitation. Implementations must override this method.- Specified by:
getSourceUnitin classClassCodeVisitorSupport- Returns:
- the source unit for this visitor
-
getClassNode
-
visitClass
Description copied from class:ClassCodeVisitorSupportVisits aClassNode, processing its annotations, package, imports, contents, and object initializers.- Specified by:
visitClassin interfaceGroovyClassVisitor- Overrides:
visitClassin classClassCodeVisitorSupport- Parameters:
node- the class node to visit
-
visitMethod
Description copied from class:ClassCodeVisitorSupportVisits aMethodNode, processing its annotations, parameter annotations, and code block.- Specified by:
visitMethodin interfaceGroovyClassVisitor- Overrides:
visitMethodin classClassCodeVisitorSupport- Parameters:
node- the method node to visit
-
visitField
Description copied from class:ClassCodeVisitorSupportVisits aFieldNode, processing its annotations and initial value expression if present.- Specified by:
visitFieldin interfaceGroovyClassVisitor- Overrides:
visitFieldin classClassCodeVisitorSupport- Parameters:
node- the field node to visit
-
visitProperty
Description copied from class:ClassCodeVisitorSupportVisits aPropertyNode, processing its annotations, initial value expression, and getter/setter blocks if present.- Specified by:
visitPropertyin interfaceGroovyClassVisitor- Overrides:
visitPropertyin classClassCodeVisitorSupport- Parameters:
node- the property node to visit
-
visitBinaryExpression
Description copied from class:CodeVisitorSupportVisits aBinaryExpression, traversing left and right operand expressions.- Specified by:
visitBinaryExpressionin interfaceGroovyCodeVisitor- Overrides:
visitBinaryExpressionin classCodeVisitorSupport- Parameters:
expression- the binary expression
-
visitConstructor
Description copied from class:ClassCodeVisitorSupportVisits aConstructorNode, processing its annotations, parameter annotations, and code block.- Specified by:
visitConstructorin interfaceGroovyClassVisitor- Overrides:
visitConstructorin classClassCodeVisitorSupport- Parameters:
node- the constructor node to visit
-
visitCatchStatement
Description copied from class:ClassCodeVisitorSupportVisits aCatchStatement, processing variable annotations and invoking the statement hook.- Specified by:
visitCatchStatementin interfaceGroovyCodeVisitor- Overrides:
visitCatchStatementin classClassCodeVisitorSupport- Parameters:
cs- the catch statement to visit
-
visitForLoop
Description copied from class:ClassCodeVisitorSupportVisits aForStatement, invoking statement hooks and processing loop variable annotations.- Specified by:
visitForLoopin interfaceGroovyCodeVisitor- Overrides:
visitForLoopin classClassCodeVisitorSupport- Parameters:
fs- the for statement to visit
-
visitMethodCallExpression
Description copied from class:CodeVisitorSupportVisits aMethodCallExpression, traversing the object expression, method expression, and argument list.- Specified by:
visitMethodCallExpressionin interfaceGroovyCodeVisitor- Overrides:
visitMethodCallExpressionin classCodeVisitorSupport- Parameters:
mce- the method call expression
-
visitDeclarationExpression
Description copied from class:ClassCodeVisitorSupportVisits aDeclarationExpressionwith annotation processing, traversing expression annotations before delegating to parent traversal.- Specified by:
visitDeclarationExpressionin interfaceGroovyCodeVisitor- Overrides:
visitDeclarationExpressionin classClassCodeVisitorSupport- Parameters:
expression- the declaration expression to visit
-
visitConstantExpression
Description copied from class:CodeVisitorSupportVisits aConstantExpression. No traversal is performed as constants contain no child expressions.- Specified by:
visitConstantExpressionin interfaceGroovyCodeVisitor- Overrides:
visitConstantExpressionin classCodeVisitorSupport- Parameters:
expression- the constant expression
-
visitGStringExpression
Description copied from class:CodeVisitorSupportVisits aGStringExpression, traversing string parts and interpolated value expressions.- Specified by:
visitGStringExpressionin interfaceGroovyCodeVisitor- Overrides:
visitGStringExpressionin classCodeVisitorSupport- Parameters:
expression- the GString expression
-