Class ClassLoaderAwareGeneratorStrategy

java.lang.Object
org.springframework.cglib.core.DefaultGeneratorStrategy
org.springframework.cglib.core.ClassLoaderAwareGeneratorStrategy
All Implemented Interfaces:
org.springframework.cglib.core.GeneratorStrategy

public class ClassLoaderAwareGeneratorStrategy extends org.springframework.cglib.core.DefaultGeneratorStrategy
CGLIB GeneratorStrategy variant which exposes the application ClassLoader as current thread context ClassLoader for the time of class generation. The ASM ClassWriter in Spring's ASM variant will pick it up when doing common superclass resolution.
Since:
5.2
Author:
Juergen Hoeller
  • Field Summary

    Fields inherited from class org.springframework.cglib.core.DefaultGeneratorStrategy

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    generate(org.springframework.cglib.core.ClassGenerator cg)
     

    Methods inherited from class org.springframework.cglib.core.DefaultGeneratorStrategy

    getClassVisitor, getClassWriter, transform, transform

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.cglib.core.GeneratorStrategy

    equals
  • Constructor Details

    • ClassLoaderAwareGeneratorStrategy

      public ClassLoaderAwareGeneratorStrategy(ClassLoader classLoader)
  • Method Details

    • generate

      public byte[] generate(org.springframework.cglib.core.ClassGenerator cg) throws Exception
      Specified by:
      generate in interface org.springframework.cglib.core.GeneratorStrategy
      Overrides:
      generate in class org.springframework.cglib.core.DefaultGeneratorStrategy
      Throws:
      Exception