org.jboss.weaver.retro
Class WeaverRetroJdk14

java.lang.Object
  extended by org.jboss.weaver.Weaver
      extended by org.jboss.weaver.retro.WeaverRetroJdk14

public class WeaverRetroJdk14
extends Weaver

Weaver configuration for converting class files to jdk1.4

Author:
pgier

Field Summary
 String DEFAULT_CLASS_RENAMES_RESOURCE
          Default resource from which to load the class renames mapping.
 
Fields inherited from class org.jboss.weaver.Weaver
pool
 
Constructor Summary
WeaverRetroJdk14()
           
 
Method Summary
 boolean doWeave(ClassLoader cl, ClassFileInfo info)
           
 void init()
          This method should be called after the classpath has been set.
 void initClassRenames()
          Initialize the classes that need to be renamed.
static void rewriteLDC(javassist.bytecode.ConstPool constPool, javassist.bytecode.MethodInfo method)
          This rewrites the load constant ClassInfo to be Class.forName()
 
Methods inherited from class org.jboss.weaver.Weaver
addCodeConverter, addExprEditor, clearClassRenames, clearCodeConverters, clearExprEditors, getClasspath, getClassPathUrls, getClassRenames, getCodeConverters, getExprEditors, getPool, loadClassRenames, putClassRename, putClassRenames, setClasspath, setClassPathUrls, setClassRenames, setPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CLASS_RENAMES_RESOURCE

public final String DEFAULT_CLASS_RENAMES_RESOURCE
Default resource from which to load the class renames mapping.

See Also:
Constant Field Values
Constructor Detail

WeaverRetroJdk14

public WeaverRetroJdk14()
Method Detail

init

public void init()
This method should be called after the classpath has been set.

Overrides:
init in class Weaver

initClassRenames

public void initClassRenames()
Initialize the classes that need to be renamed.


doWeave

public boolean doWeave(ClassLoader cl,
                       ClassFileInfo info)
                throws javassist.bytecode.BadBytecode,
                       javassist.CannotCompileException
Overrides:
doWeave in class Weaver
Throws:
javassist.bytecode.BadBytecode
javassist.CannotCompileException

rewriteLDC

public static void rewriteLDC(javassist.bytecode.ConstPool constPool,
                              javassist.bytecode.MethodInfo method)
                       throws javassist.bytecode.BadBytecode
This rewrites the load constant ClassInfo to be Class.forName()

Parameters:
constPool - the constant pool
method - the method
Throws:
Exception - for any error
javassist.bytecode.BadBytecode


Copyright © 2005-2007 JBoss, a division of Red Hat, Inc. All Rights Reserved.