FileDocCategorySizeDatePackage
ClassDefinition.javaAPI DocJava SE 6 API1839Tue Jun 10 00:25:38 BST 2008java.lang.instrument

ClassDefinition

public final class ClassDefinition extends Object
This class serves as a parameter block to the Instrumentation.redefineClasses method. Serves to bind the Class that needs redefining together with the new class file bytes.
see
java.lang.instrument.Instrumentation#redefineClasses
since
1.5

Fields Summary
private final Class
mClass
The class to redefine
private final byte[]
mClassFile
The replacement class file bytes
Constructors Summary
public ClassDefinition(Class theClass, byte[] theClassFile)
Creates a new ClassDefinition binding using the supplied class and class file bytes. Does not copy the supplied buffer, just captures a reference to it.

param
theClass the Class that needs redefining
param
theClassFile the new class file bytes
throws
java.lang.NullPointerException if the supplied class or array is null.

        if (theClass == null || theClassFile == null) {
            throw new NullPointerException();
        }
        mClass      = theClass;
        mClassFile  = theClassFile;
    
Methods Summary
public java.lang.ClassgetDefinitionClass()
Returns the class.

return
the Class object referred to.

        return mClass;
    
public byte[]getDefinitionClassFile()
Returns the array of bytes that contains the new class file.

return
the class file bytes.

        return mClassFile;