FileDocCategorySizeDatePackage
ClassDefinition.javaAPI DocAndroid 1.5 API2915Wed May 06 22:41:02 BST 2009java.lang.instrument

ClassDefinition

public final class ClassDefinition extends Object
Wraps a {@link java.lang.Class} that is to be redefined together with the byte array which constitutes the updated version of the class.

Fields Summary
private Class
definitionClass
The Class object for the class that will be instrumented.
private byte[]
definitionClassFile
The new version of the class file bytes for the class being instrumented.
Constructors Summary
public ClassDefinition(Class theClass, byte[] theClassFile)
Constructs a new instance of ClassDefinition with the supplied {@link Class} object and byte array representing the new class file bytes.

param
theClass the Class object for the class to be redefined
param
theClassFile an array of bytes containing the updated version of the class to be redefined.
throws
NullPointerException if either theClass or theClassFile are null.

        if (theClass == null) {
            throw new NullPointerException(Messages.getString("instrument.1")); //$NON-NLS-1$
        }
        if (theClassFile == null) {
            throw new NullPointerException(Messages.getString("instrument.2")); //$NON-NLS-1$
        }
        this.definitionClass = theClass;
        this.definitionClassFile = theClassFile;
    
Methods Summary
public java.lang.ClassgetDefinitionClass()
Returns the {@link Class} object for the class to be redefined.

return
the Class object

        return this.definitionClass;
    
public byte[]getDefinitionClassFile()
Returns a reference to the byte array containing the re-engineered version of the class.

return
byte array containing the new version of the class

        return this.definitionClassFile;