CGLib (Code Generation Library) is a run time code generation library for the Java platform licensed under the Apache 2.0 license.
CGLib (Code Generation Library) is mainly used the generation of class proxies. This is achieved by creating subclasses at run time where method invocations are intercepted by user defined methods. Additionally, cglib offers different extension such as for example bean utilities. cglib is built on top of ASM.
Alternative code generation libraries for the JVM that are still under active development are: