docs: static void generateClassMethods(ClassWriter classWriter, String typeName, String className, String apiName, boolean performVisits) {
          String classType = getFullClassTypeName(typeName, apiName);
          String classTypeDesc = getFullClassTypeNameDesc(typeName, apiName);
          String name = firstToLower(className);
  
          FieldVisitor fVisitor = classWriter.visitField(ACC_PROTECTED + ACC_FINAL, "parent", elementTypeDesc, "TZ;", null);
          fVisitor.visitEnd();
  
          fVisitor = classWriter.visitField(ACC_PROTECTED + ACC_FINAL, "visitor", elementVisitorTypeDesc, null, null);
          fVisitor.visitEnd();
  
          MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC, CONSTRUCTOR, "(" + elementVisitorTypeDesc + ")V", null, null);
          mVisitor.visitLocalVariable("visitor", elementVisitorTypeDesc, null, new Label(), new Label(),1);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKESPECIAL, JAVA_OBJECT, CONSTRUCTOR, "()V", false);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "visitor", elementVisitorTypeDesc);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitInsn(ACONST_NULL);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "parent", elementTypeDesc);
  
          if (performVisits){
              mVisitor.visitVarInsn(ALOAD, 1);
              mVisitor.visitVarInsn(ALOAD, 0);
              mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitElement" + getCleanName(className), "(" + classTypeDesc + ")V", false);
          }
  
          mVisitor.visitInsn(RETURN);
          mVisitor.visitMaxs(2, 2);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC, CONSTRUCTOR, "(" + elementTypeDesc + ")V", "(TZ;)V", null);
          mVisitor.visitLocalVariable("parent", elementTypeDesc, null, new Label(), new Label(),1);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKESPECIAL, JAVA_OBJECT, CONSTRUCTOR, "()V", false);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "parent", elementTypeDesc);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitMethodInsn(INVOKEINTERFACE, elementType, "getVisitor", "()" + elementVisitorTypeDesc, true);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "visitor", elementVisitorTypeDesc);
  
          if (performVisits) {
              mVisitor.visitVarInsn(ALOAD, 0);
              mVisitor.visitFieldInsn(GETFIELD, classType, "visitor", elementVisitorTypeDesc);
              mVisitor.visitVarInsn(ALOAD, 0);
              mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitElement" + getCleanName(className), "(" + classTypeDesc + ")V", false);
          }
  
          mVisitor.visitInsn(RETURN);
          mVisitor.visitMaxs(2, 2);
          mVisitor.visitEnd();
  
  
          mVisitor = classWriter.visitMethod(ACC_PROTECTED, CONSTRUCTOR, "(" + elementTypeDesc + elementVisitorTypeDesc + "Z)V", "(TZ;" + elementVisitorTypeDesc + "Z)V", null);
          mVisitor.visitLocalVariable("parent", elementTypeDesc, null, new Label(), new Label(),1);
          mVisitor.visitLocalVariable("visitor", elementVisitorTypeDesc, null, new Label(), new Label(),2);
          mVisitor.visitLocalVariable("shouldVisit", "Z", null, new Label(), new Label(),3);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKESPECIAL, JAVA_OBJECT, CONSTRUCTOR, "()V", false);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "parent", elementTypeDesc);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitVarInsn(ALOAD, 2);
          mVisitor.visitFieldInsn(PUTFIELD, classType, "visitor", elementVisitorTypeDesc);
  
          if (performVisits) {
              mVisitor.visitVarInsn(ILOAD, 3);
              Label l0 = new Label();
              mVisitor.visitJumpInsn(IFEQ, l0);
              mVisitor.visitVarInsn(ALOAD, 2);
              mVisitor.visitVarInsn(ALOAD, 0);
              mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitElement" + getCleanName(className), "(" + classTypeDesc + ")V", false);
              mVisitor.visitLabel(l0);
              mVisitor.visitFrame(Opcodes.F_FULL, 4, new Object[]{classType, elementType, elementVisitorType, Opcodes.INTEGER}, 0, new Object[]{});
          }
  
          mVisitor.visitInsn(RETURN);
          mVisitor.visitMaxs(2, 4);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC, "__", "()" + elementTypeDesc, "()TZ;", null);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "visitor", elementVisitorTypeDesc);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitParent" + getCleanName(typeName), "(" + classTypeDesc + ")V", false);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "parent", elementTypeDesc);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(2, 1);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_FINAL, "dynamic", "(Ljava/util/function/Consumer;)" + classTypeDesc, "(Ljava/util/function/Consumer<L" + classType + "<TZ;>;>;)L" + classType + "<TZ;>;", null);
          mVisitor.visitLocalVariable("consumer", "Ljava/util/function/Consumer;", null, new Label(), new Label(),1);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "visitor", elementVisitorTypeDesc);
          mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitOpenDynamic", "()V", false);
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKEINTERFACE, "java/util/function/Consumer", "accept", "(" + JAVA_OBJECT_DESC + ")V", true);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "visitor", elementVisitorTypeDesc);
          mVisitor.visitMethodInsn(INVOKEVIRTUAL, elementVisitorType, "visitCloseDynamic", "()V", false);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(2, 2);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_FINAL, "of", "(Ljava/util/function/Consumer;)" + classTypeDesc, "(Ljava/util/function/Consumer<L" + classType + "<TZ;>;>;)L" + classType + "<TZ;>;", null);
          mVisitor.visitLocalVariable("consumer", "Ljava/util/function/Consumer;", null, new Label(), new Label(),1);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 1);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKEINTERFACE, "java/util/function/Consumer", "accept", "(" + JAVA_OBJECT_DESC + ")V", true);
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(2, 2);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC, "getParent", "()" + elementTypeDesc, "()TZ;", null);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "parent", elementTypeDesc);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(1, 1);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_FINAL, "getVisitor", "()" + elementVisitorTypeDesc, null, null);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitFieldInsn(GETFIELD, classType, "visitor", elementVisitorTypeDesc);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(1, 1);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC, "getName", "()" + JAVA_STRING_DESC, null, null);
          mVisitor.visitCode();
          mVisitor.visitLdcInsn(name);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(1, 1);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_FINAL, "self", "()" + classTypeDesc, "()L" + classType + "<TZ;>;", null);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(1, 1);
          mVisitor.visitEnd();
  
          mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC, "self", "()" + elementTypeDesc, null, null);
          mVisitor.visitCode();
          mVisitor.visitVarInsn(ALOAD, 0);
          mVisitor.visitMethodInsn(INVOKEVIRTUAL, classType, "self", "()" + classTypeDesc, false);
          mVisitor.visitInsn(ARETURN);
          mVisitor.visitMaxs(1, 1);
          mVisitor.visitEnd();
      }