public class Instrumenter
extends java.lang.Object
Constructor | Description |
---|---|
Instrumenter(IExecutionDataAccessorGenerator runtime) |
Creates a new instance based on the given runtime.
|
Modifier and Type | Method | Description |
---|---|---|
byte[] |
instrument(byte[] buffer,
java.lang.String name) |
Creates a instrumented version of the given class if possible.
|
void |
instrument(java.io.InputStream input,
java.io.OutputStream output,
java.lang.String name) |
Creates a instrumented version of the given class file.
|
byte[] |
instrument(java.io.InputStream input,
java.lang.String name) |
Creates a instrumented version of the given class if possible.
|
byte[] |
instrument(org.objectweb.asm.ClassReader reader) |
Creates a instrumented version of the given class if possible.
|
int |
instrumentAll(java.io.InputStream input,
java.io.OutputStream output,
java.lang.String name) |
Creates a instrumented version of the given resource depending on its
type.
|
void |
setRemoveSignatures(boolean flag) |
Determines whether signatures should be removed from JAR files.
|
public Instrumenter(IExecutionDataAccessorGenerator runtime)
runtime
- runtime used by the instrumented classespublic void setRemoveSignatures(boolean flag)
true
.flag
- true
if signatures should be removedpublic byte[] instrument(org.objectweb.asm.ClassReader reader)
reader
- definition of the class as ASM readerpublic byte[] instrument(byte[] buffer, java.lang.String name) throws java.io.IOException
buffer
- definition of the classname
- a name used for exception messagesjava.io.IOException
- if the class can't be instrumentedpublic byte[] instrument(java.io.InputStream input, java.lang.String name) throws java.io.IOException
InputStream
is not closed by this method.input
- stream to read class definition fromname
- a name used for exception messagesjava.io.IOException
- if reading data from the stream fails or the class can't be
instrumentedpublic void instrument(java.io.InputStream input, java.io.OutputStream output, java.lang.String name) throws java.io.IOException
InputStream
and OutputStream
instances are not closed by
this method.input
- stream to read class definition fromoutput
- stream to write the instrumented version of the class toname
- a name used for exception messagesjava.io.IOException
- if reading data from the stream fails or the class can't be
instrumentedpublic int instrumentAll(java.io.InputStream input, java.io.OutputStream output, java.lang.String name) throws java.io.IOException
InputStream
and OutputStream
instances are not closed by
this method.input
- stream to contents fromoutput
- stream to write the instrumented version of the contentsname
- a name used for exception messagesjava.io.IOException
- if reading data from the stream fails or a class can't be
instrumentedCopyright © 2018. All rights reserved.