org.springsource.loaded
Class ClassRenamer

java.lang.Object
  extended by org.springsource.loaded.ClassRenamer

public class ClassRenamer
extends java.lang.Object

Modify a class by changing it from one name to another. References to other types can also be changed. Basically used in the test suite.

Since:
0.5.0

Constructor Summary
ClassRenamer()
           
 
Method Summary
static byte[] rename(java.lang.String dottedNewName, byte[] classbytes, java.lang.String... retargets)
          Rename a type - changing it to specified new name (which should be the dotted form of the name).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassRenamer

public ClassRenamer()
Method Detail

rename

public static byte[] rename(java.lang.String dottedNewName,
                            byte[] classbytes,
                            java.lang.String... retargets)
Rename a type - changing it to specified new name (which should be the dotted form of the name). Retargets are an optional sequence of retargets to also perform during the rename. Retargets take the form of "a.b:a.c" which will change all references to a.b to a.c.

Parameters:
dottedNewName - dotted name, e.g. com.foo.Bar
classbytes - the bytecode for the class to be renamed
retargets - retarget rules for references, of the form "a.b:b.a","c.d:d.c"
Returns:
bytecode for the modified class