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`

public class DummyClassGenerator extends ClassGenerator
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

  Constructors
  Constructor
  Description
  `DummyClassGenerator(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 Type
  Method
  Description
  `protected CompileUnit`
  `getCompileUnit()`
  Returns the compile unit associated with the class currently being emitted.
  `void`
  `visitAnnotations(AnnotatedNode node)`
  Visits annotations on an `AnnotatedNode`, delegating to `ClassCodeVisitorSupport.visitAnnotation(AnnotationNode)`.
  `void`
  `visitClass(ClassNode classNode)`
  Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
  `void`
  `visitConstructor(ConstructorNode node)`
  Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
  `void`
  `visitField(FieldNode fieldNode)`
  Visits a `FieldNode`, processing its annotations and initial value expression if present.
  `void`
  `visitMethod(MethodNode node)`
  Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
  `protected void`
  `visitParameter(ASTNode node, Parameter parameter)`
  Visits a single parameter declared by the supplied member node.
  `protected void`
  `visitParameters(ASTNode node, Parameter[] parameters)`
  Visits the parameters declared by the supplied member node.
  `void`
  `visitProperty(PropertyNode statement)`
  Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.

  ### Methods inherited from class org.codehaus.groovy.classgen.ClassGenerator

  `getInnerClasses, getSourceUnit, visitBytecodeSequence`

  ### Methods 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, visitWhileLoop`

  ### Methods 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, 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

  `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 context
      `classVisitor` - the ASM class visitor to write to
      `classLoader` - the class loader (currently unused)
      `sourceFile` - the source file name (currently unused)

- ## Method Details

  - ### visitClass

    public void visitClass(ClassNode classNode)
    Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
    Specified by:
      `visitClass` in interface `GroovyClassVisitor`
    Overrides:
      `visitClass` in class `ClassCodeVisitorSupport`
    Parameters:
      `classNode` - the class node to visit

  - ### visitConstructor

    public void visitConstructor(ConstructorNode node)
    Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitConstructor` in interface `GroovyClassVisitor`
    Overrides:
      `visitConstructor` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the constructor node to visit

  - ### visitMethod

    public void visitMethod(MethodNode node)
    Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitMethod` in interface `GroovyClassVisitor`
    Overrides:
      `visitMethod` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the method node to visit

  - ### visitField

    public void visitField(FieldNode fieldNode)
    Visits a `FieldNode`, processing its annotations and initial value expression if present.
    Specified by:
      `visitField` in interface `GroovyClassVisitor`
    Overrides:
      `visitField` in class `ClassCodeVisitorSupport`
    Parameters:
      `fieldNode` - the field node to visit

  - ### visitProperty

    public void visitProperty(PropertyNode statement)
    Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.
    Specified by:
      `visitProperty` in interface `GroovyClassVisitor`
    Overrides:
      `visitProperty` in class `ClassCodeVisitorSupport`
    Parameters:
      `statement` - the property node to visit

  - ### visitAnnotations

    public void visitAnnotations(AnnotatedNode node)
    Visits annotations on an `AnnotatedNode`, delegating to `ClassCodeVisitorSupport.visitAnnotation(AnnotationNode)`.
    Overrides:
      `visitAnnotations` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the annotated node containing annotations to visit

  - ### visitParameters

    protected void visitParameters(ASTNode node, Parameter[] parameters)
    Visits the parameters declared by the supplied member node.
    Parameters:
      `node` - the owning constructor or method
      `parameters` - the parameters to visit

  - ### visitParameter

    protected void visitParameter(ASTNode node, Parameter parameter)
    Visits a single parameter declared by the supplied member node.
    Parameters:
      `node` - the owning constructor or method
      `parameter` - the parameter to visit

  - ### getCompileUnit

    protected CompileUnit getCompileUnit()
    Returns the compile unit associated with the class currently being emitted.
    Returns:
      the active compile unit