/** * Visits the source of the class. * * @param source the name of the source file from which the class was compiled. May be {@literal * null}. * @param debug additional debug information to compute the correspondence between source and * compiled elements of the class. May be {@literal null}. */ public void visitSource(final String source, final String debug) { if (cv != null) { cv.visitSource(source, debug); } }
public void visitSource(final String source, final String debug) { cv.visitSource(source, debug); }
/** * Visits the source of the class. * * @param source * the name of the source file from which the class was compiled. * May be <tt>null</tt>. * @param debug * additional debug information to compute the correspondance * between source and compiled elements of the class. May be * <tt>null</tt>. */ public void visitSource(String source, String debug) { if (cv != null) { cv.visitSource(source, debug); } }
@Override public void begin(final String name, final Attributes attrs) { String file = attrs.getValue("file"); String debug = attrs.getValue("debug"); cv.visitSource(file, debug); } }
@Override public void visitSource(final String file, final String debug) { p.visitSource(file, debug); super.visitSource(file, debug); }
@Override public void visitSource(final String file, final String debug) { checkState(); if (source) { throw new IllegalStateException( "visitSource can be called only once."); } source = true; super.visitSource(file, debug); }
public void visitSource(final String file, final String debug) { buf.setLength(0); if (file != null) { buf.append(tab) .append("// compiled from: ") .append(file) .append('\n'); } if (debug != null) { buf.append(tab) .append("// debug info: ") .append(debug) .append('\n'); } if (buf.length() > 0) { text.add(buf.toString()); } if (cv != null) { cv.visitSource(file, debug); } }
cv.visitSource(sourceFile, sourceDebug);
/** * Defines the class header for the given class definition * * @param cw * @param classDef */ protected void buildClassHeader(ClassVisitor cw, ClassDefinition classDef) { String[] original = classDef.getInterfaces(); String[] interfaces = new String[original.length]; for ( int i = 0; i < original.length; i++ ) { interfaces[i] = BuildUtils.getInternalType( original[i] ); } int classModifiers = Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER; if ( classDef.isAbstrakt() ) { classModifiers += Opcodes.ACC_ABSTRACT; } // Building class header cw.visit( Opcodes.V1_5, classModifiers, BuildUtils.getInternalType( classDef.getClassName() ), null, BuildUtils.getInternalType( classDef.getSuperClass() ), interfaces ); buildClassAnnotations(classDef, cw); cw.visitSource( classDef.getClassName() + ".java", null ); }
classVisitor.visitSource(sourceFile, sourceDebugExtension);
classVisitor.visitSource(sourceFile, sourceDebug);
classVisitor.visitSource(sourceFile, sourceDebug);