APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang.instrument

public final Class ClassDefinition

extends Object
Class Inheritance

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.
Since
1.5
See Also
java.lang.instrument.Instrumentation#redefineClasses

Field Summary

Modifier and TypeField and Description
private final Class<?>
mClass

The class to redefine

private final byte[]
mClassFile

The replacement class file bytes

Constructor Summary

AccessConstructor and Description
public
ClassDefinition(Class<?>
the Class that needs redefining
theClass
,
byte[]
the new class file bytes
theClassFile
)

Creates a new ClassDefinition binding using the supplied class and class file bytes.

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

the Class object referred to.
getDefinitionClass
()

Returns the class.

public byte[]

Returns:

the class file bytes.
getDefinitionClassFile
()

Returns the array of bytes that contains the new class file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mClassback to summary
private final Class<?> mClass

The class to redefine

mClassFileback to summary
private final byte[] mClassFile

The replacement class file bytes

Constructor Detail

ClassDefinitionback to 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.

Parameters
theClass:Class<?>

the Class that needs redefining

theClassFile:byte[]

the new class file bytes

Exceptions
NullPointerException:
if the supplied class or array is null.

Method Detail

getDefinitionClassback to summary
public Class<?> getDefinitionClass()

Returns the class.

Returns:Class<?>

the Class object referred to.

getDefinitionClassFileback to summary
public byte[] getDefinitionClassFile()

Returns the array of bytes that contains the new class file.

Returns:byte[]

the class file bytes.