mockit.external.asm.WrappingClassVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmockit Show documentation
Show all versions of jmockit Show documentation
JMockit is a Java toolkit for automated developer testing.
It contains APIs for the creation of the objects to be tested, for mocking dependencies, and for faking external
APIs; JUnit (4 & 5) and TestNG test runners are supported.
It also contains an advanced code coverage tool.
package mockit.external.asm;
import javax.annotation.*;
/**
* Same as {@link ClassVisitor}, except it always wraps a {@link ClassWriter}.
*/
public class WrappingClassVisitor extends ClassVisitor
{
/**
* The class visitor to which this visitor must delegate method calls.
*/
@Nonnull protected final ClassWriter cw;
/**
* Constructs a new {@link WrappingClassVisitor}.
*
* @param cw the class writer to which this visitor must delegate method calls.
*/
protected WrappingClassVisitor(@Nonnull ClassWriter cw) { this.cw = cw; }
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
cw.visit(version, access, name, signature, superName, interfaces);
}
@Override
public void visitSource(String source, String debug) {
cw.visitSource(source, debug);
}
@Override
public void visitOuterClass(String owner, String name, String desc) {
cw.visitOuterClass(owner, name, desc);
}
@Override
public AnnotationVisitor visitAnnotation(String desc) {
return cw.visitAnnotation(desc);
}
@Override
public void visitInnerClass(String name, String outerName, String innerName, int access) {
cw.visitInnerClass(name, outerName, innerName, access);
}
@Override
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
return cw.visitField(access, name, desc, signature, value);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return cw.visitMethod(access, name, desc, signature, exceptions);
}
@Override
public void visitEnd() {
cw.visitEnd();
}
@Override
public final byte[] toByteArray() { return cw.toByteArray(); }
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy