If a transformer has been registered with the class loading layer, the transformer will be called for every new class definition. The request for a new class definition is made with defineClass The transformer is called during the processing of the request, before the class file bytes have been verified or applied.
If the implementing method determines that no transformations are needed, it should return null
. Otherwise, it should create a new byte[] array and copy the input classfileBuffer
into it, along with all desired transformations. The input classfileBuffer
must not be modified.
@param loader - the defining loader of the class to be transformed, maybe null
if the bootstrap loader
@param className - the fully-qualified name of the class
@param classBeingRedefined - if this is a redefine, the class beingredefined, otherwise null
@param protectionDomain - the protection domain of the class beingdefined or redefined
@param classfileBuffer - the input byte buffer in class file format - mustnot be modified
@throws Exception - if the input does not represent a well-formed class file
@return a well-formed class file buffer (the result of the transform), or null
if no transform is performed.
|
|
|
|