sf logo

sf.qof.util
Class DefineClassHelper

java.lang.Object
  extended by sf.qof.util.DefineClassHelper

public class DefineClassHelper
extends Object

Helper class to call the defineClass method of the ClassLoader.

See Also:
ClassLoader

Constructor Summary
DefineClassHelper()
           
 
Method Summary
static
<T> Class<T>
defineClass(String className, byte[] byteCode, ClassLoader loader)
          Calls ClassLoader.defineClass and returns a Class instance if successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefineClassHelper

public DefineClassHelper()
Method Detail

defineClass

public static <T> Class<T> defineClass(String className,
                                       byte[] byteCode,
                                       ClassLoader loader)
                            throws Exception
Calls ClassLoader.defineClass and returns a Class instance if successful.

Type Parameters:
T - type of the class
Parameters:
className - class name
byteCode - array containing the byte code of the class
loader - class loader
Returns:
newly defined class
Throws:
Exception - error occurred
See Also:
ClassLoader

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.