com.google.inject.internal
Class BytecodeGen

java.lang.Object
  extended by com.google.inject.internal.BytecodeGen

public final class BytecodeGen
extends Object

Utility methods for runtime code generation and class loading. We use this stuff for faster reflection, method interceptors and to proxy circular dependencies.

When loading classes, we need to be careful of:

For each generated class, there's multiple class loaders involved:

Author:
[email protected] (Stuart McCulloch), [email protected] (Jesse Wilson)

Nested Class Summary
static class BytecodeGen.Visibility
          The required visibility of a user's class from a Guice-generated class.
 
Constructor Summary
BytecodeGen()
           
 
Method Summary
static ClassLoader getClassLoader(Class<?> type)
          Returns the class loader to host generated classes for type.
static net.sf.cglib.proxy.Enhancer newEnhancer(Class<?> type, BytecodeGen.Visibility visibility)
           
static net.sf.cglib.reflect.FastClass newFastClass(Class<?> type, BytecodeGen.Visibility visibility)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytecodeGen

public BytecodeGen()
Method Detail

getClassLoader

public static ClassLoader getClassLoader(Class<?> type)
Returns the class loader to host generated classes for type.


newFastClass

public static net.sf.cglib.reflect.FastClass newFastClass(Class<?> type,
                                                          BytecodeGen.Visibility visibility)

newEnhancer

public static net.sf.cglib.proxy.Enhancer newEnhancer(Class<?> type,
                                                      BytecodeGen.Visibility visibility)


Copyright © 2006-2011 Google, Inc.. All Rights Reserved.