public abstract class

ClassFileTransformer

extends Object
java.lang.Object
   ↳ sun.misc.ClassFileTransformer

Class Overview

This is an abstract base class which is called by java.lang.ClassLoader when ClassFormatError is thrown inside defineClass(). The purpose of this class is to allow applications (e.g. Java Plug-in) to have a chance to transform the byte code from one form to another if necessary. One application of this class is used by Java Plug-in to transform malformed JDK 1.1 class file into a well-formed Java 2 class file on-the-fly, so JDK 1.1 applets with malformed class file in the Internet may run in Java 2 after transformation.

Summary

Public Constructors
ClassFileTransformer()
Public Methods
static void add(ClassFileTransformer t)
Add the class file transformer object.
static Object[] getTransformers()
Get the array of ClassFileTransformer object.
abstract byte[] transform(byte[] b, int off, int len)
Transform a byte array from one to the other.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClassFileTransformer ()

Public Methods

public static void add (ClassFileTransformer t)

Add the class file transformer object.

Parameters
t Class file transformer instance

public static Object[] getTransformers ()

Get the array of ClassFileTransformer object.

Returns
  • ClassFileTransformer object array

public abstract byte[] transform (byte[] b, int off, int len)

Transform a byte array from one to the other.

Parameters
b Byte array
off Offset
len Length of byte array
Returns
  • Transformed byte array