Package org.codehaus.groovy.classgen
Class DummyClassGenerator
java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.classgen.ClassGenerator
org.codehaus.groovy.classgen.DummyClassGenerator
- All Implemented Interfaces:
GroovyClassVisitor,GroovyCodeVisitor,ErrorCollecting
To generate a class that has all the fields and methods, except that fields are not initialized
and methods are empty. It's intended for being used as a placeholder during code generation
of reference to the "this" class itself.
-
Field Summary
Fields inherited from class org.codehaus.groovy.classgen.ClassGenerator
innerClasses -
Constructor Summary
ConstructorsConstructorDescriptionDummyClassGenerator(GeneratorContext context, org.objectweb.asm.ClassVisitor classVisitor, ClassLoader classLoader, String sourceFile) Creates a new dummy class generator that produces class structures without implementation. -
Method Summary
Modifier and TypeMethodDescriptionprotected CompileUnitReturns the compile unit associated with the class currently being emitted.voidVisits annotations on anAnnotatedNode, delegating toClassCodeVisitorSupport.visitAnnotation(AnnotationNode).voidvisitClass(ClassNode classNode) Visits aClassNode, processing its annotations, package, imports, contents, and object initializers.voidVisits aConstructorNode, processing its annotations, parameter annotations, and code block.voidvisitField(FieldNode fieldNode) Visits aFieldNode, processing its annotations and initial value expression if present.voidvisitMethod(MethodNode node) Visits aMethodNode, processing its annotations, parameter annotations, and code block.protected voidvisitParameter(ASTNode node, Parameter parameter) Visits a single parameter declared by the supplied member node.protected voidvisitParameters(ASTNode node, Parameter[] parameters) Visits the parameters declared by the supplied member node.voidvisitProperty(PropertyNode statement) Visits aPropertyNode, processing its annotations, initial value expression, and getter/setter blocks if present.Methods inherited from class org.codehaus.groovy.classgen.ClassGenerator
getInnerClasses, getSourceUnit, visitBytecodeSequenceMethods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitClosureExpression, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitForLoop, 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, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, 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
-
DummyClassGenerator
public DummyClassGenerator(GeneratorContext context, org.objectweb.asm.ClassVisitor classVisitor, ClassLoader classLoader, String sourceFile) Creates a new dummy class generator that produces class structures without implementation.- Parameters:
context- the generator contextclassVisitor- the ASM class visitor to write toclassLoader- the class loader (currently unused)sourceFile- the source file name (currently unused)
-
-
Method Details
-
visitClass
Visits aClassNode, processing its annotations, package, imports, contents, and object initializers.- Specified by:
visitClassin interfaceGroovyClassVisitor- Overrides:
visitClassin classClassCodeVisitorSupport- Parameters:
classNode- the class node to visit
-
visitConstructor
Visits aConstructorNode, processing its annotations, parameter annotations, and code block.- Specified by:
visitConstructorin interfaceGroovyClassVisitor- Overrides:
visitConstructorin classClassCodeVisitorSupport- Parameters:
node- the constructor node to visit
-
visitMethod
Visits aMethodNode, processing its annotations, parameter annotations, and code block.- Specified by:
visitMethodin interfaceGroovyClassVisitor- Overrides:
visitMethodin classClassCodeVisitorSupport- Parameters:
node- the method node to visit
-
visitField
Visits aFieldNode, processing its annotations and initial value expression if present.- Specified by:
visitFieldin interfaceGroovyClassVisitor- Overrides:
visitFieldin classClassCodeVisitorSupport- Parameters:
fieldNode- the field node to visit
-
visitProperty
Visits aPropertyNode, processing its annotations, initial value expression, and getter/setter blocks if present.- Specified by:
visitPropertyin interfaceGroovyClassVisitor- Overrides:
visitPropertyin classClassCodeVisitorSupport- Parameters:
statement- the property node to visit
-
visitAnnotations
Visits annotations on anAnnotatedNode, delegating toClassCodeVisitorSupport.visitAnnotation(AnnotationNode).- Overrides:
visitAnnotationsin classClassCodeVisitorSupport- Parameters:
node- the annotated node containing annotations to visit
-
visitParameters
Visits the parameters declared by the supplied member node.- Parameters:
node- the owning constructor or methodparameters- the parameters to visit
-
visitParameter
Visits a single parameter declared by the supplied member node.- Parameters:
node- the owning constructor or methodparameter- the parameter to visit
-
getCompileUnit
Returns the compile unit associated with the class currently being emitted.- Returns:
- the active compile unit
-