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
public class ClassCompletionVerifier extends ClassCodeVisitorSupport
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 Constructor Description ClassCompletionVerifier(SourceUnit source)
-
Method Summary
Modifier and Type Method Description ClassNode
getClassNode()
protected SourceUnit
getSourceUnit()
void
visitBinaryExpression(BinaryExpression expression)
void
visitCatchStatement(CatchStatement cs)
void
visitClass(ClassNode node)
Visit a ClassNode.void
visitConstantExpression(ConstantExpression expression)
void
visitConstructor(ConstructorNode node)
Visit a ConstructorNode.void
visitDeclarationExpression(DeclarationExpression expression)
void
visitField(FieldNode node)
Visit a FieldNode.void
visitGStringExpression(GStringExpression expression)
void
visitMethod(MethodNode node)
Visit a MethodNode.void
visitMethodCallExpression(MethodCallExpression mce)
void
visitProperty(PropertyNode node)
Visit a PropertyNode.Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitClassCodeContainer, visitConstructorOrMethod, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitForLoop, visitIfElse, visitImports, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop
Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor
visitEmptyExpression, visitListOfExpressions
-
Constructor Details
-
ClassCompletionVerifier
-
-
Method Details
-
getClassNode
-
visitClass
Description copied from interface:GroovyClassVisitor
Visit a ClassNode.- Specified by:
visitClass
in interfaceGroovyClassVisitor
- Overrides:
visitClass
in classClassCodeVisitorSupport
-
getSourceUnit
- Specified by:
getSourceUnit
in classClassCodeVisitorSupport
-
visitMethod
Description copied from interface:GroovyClassVisitor
Visit a MethodNode.- Specified by:
visitMethod
in interfaceGroovyClassVisitor
- Overrides:
visitMethod
in classClassCodeVisitorSupport
-
visitField
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitProperty
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitBinaryExpression
- Specified by:
visitBinaryExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitBinaryExpression
in classCodeVisitorSupport
-
visitConstructor
Description copied from interface:GroovyClassVisitor
Visit a ConstructorNode.- Specified by:
visitConstructor
in interfaceGroovyClassVisitor
- Overrides:
visitConstructor
in classClassCodeVisitorSupport
-
visitCatchStatement
- Specified by:
visitCatchStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCatchStatement
in classClassCodeVisitorSupport
-
visitMethodCallExpression
- Specified by:
visitMethodCallExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitMethodCallExpression
in classCodeVisitorSupport
-
visitDeclarationExpression
- Specified by:
visitDeclarationExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitDeclarationExpression
in classClassCodeVisitorSupport
-
visitConstantExpression
- Specified by:
visitConstantExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitConstantExpression
in classCodeVisitorSupport
-
visitGStringExpression
- Specified by:
visitGStringExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitGStringExpression
in classCodeVisitorSupport
-