/** * Makes the given class visitor visit this class. * * @param cv a class visitor. */ public void accept(final ClassVisitor cv) { // visits header String[] interfaces = new String[this.interfaces.size()]; this.interfaces.toArray(interfaces); cv.visit(version, access, name, signature, superName, interfaces); // visits source if (sourceFile != null || sourceDebug != null) { cv.visitSource(sourceFile, sourceDebug); } // visits outer class if (outerClass != null) { cv.visitOuterClass(outerClass, outerMethod, outerMethodDesc); } // visits attributes int i, n; n = visibleAnnotations == null ? 0 : visibleAnnotations.size(); for (i = 0; i < n; ++i) { AnnotationNode an = visibleAnnotations.get(i); an.accept(cv.visitAnnotation(an.desc, true)); } n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size(); for (i = 0; i < n; ++i) { AnnotationNode an = invisibleAnnotations.get(i); an.accept(cv.visitAnnotation(an.desc, false)); } n = attrs == null ? 0 : attrs.size(); for (i = 0; i < n; ++i) { cv.visitAttribute(attrs.get(i)); } // visits inner classes for (i = 0; i < innerClasses.size(); ++i) { innerClasses.get(i).accept(cv); } // visits fields for (i = 0; i < fields.size(); ++i) { fields.get(i).accept(cv); } // visits methods for (i = 0; i < methods.size(); ++i) { methods.get(i).accept(cv); } // visits end cv.visitEnd(); }
/** * Visits the enclosing class of the class. This method must be called only if the class has an * enclosing class. * * @param owner internal name of the enclosing class of the class. * @param name the name of the method that contains the class, or <tt>null</tt> if the class is * not enclosed in a method of its enclosing class. * @param desc the descriptor of the method that contains the class, or <tt>null</tt> if the class * is not enclosed in a method of its enclosing class. */ public void visitOuterClass(String owner, String name, String desc) { if (cv != null) { cv.visitOuterClass(owner, name, desc); } }
public void visitOuterClass(final String owner, final String name, final String desc) { cv.visitOuterClass(owner, name, desc); }
private void writeOuterInfo(@NotNull ClassVisitor visitor) { InlineCallSiteInfo info = inliningContext.getCallSiteInfo(); visitor.visitOuterClass( info.getOwnerClassName(), info.getFunctionName(), info.getFunctionDesc()); }