Class CodeGeneratorUtil
java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.CodeGeneratorUtil
Class used to get a class directly from code generated by
a runtime code generator.
The code generator extends this base class, and must implement
the getClassData method.
Most of this is independent of BCEL, but finalizeMethod is
specific to the BCEL framework.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class
<?> Defines a class in the same classloader as a specified "anchor" classstatic Class
<?> makeClass
(String name, byte[] def, ProtectionDomain pd, ClassLoader loader) Deprecated.as of Java 11, use #makeClass(String,byte[],Class)
-
Field Details
-
BRIDGE_REF
-
CONSTRUCTOR_METHOD_NAME
- See Also:
-
-
Constructor Details
-
CodeGeneratorUtil
private CodeGeneratorUtil()
-
-
Method Details
-
makeClass
@Deprecated public static Class<?> makeClass(String name, byte[] def, ProtectionDomain pd, ClassLoader loader) Deprecated.as of Java 11, use #makeClass(String,byte[],Class)Defines a class in a classloader.- Parameters:
name
- the name of the class to definedef
- the byte-code definition of the new classpd
- the protection domainloader
- the classloader in which to define the class- Returns:
- a newly created class in the specified classloader
-
makeClass
Defines a class in the same classloader as a specified "anchor" class- Parameters:
name
- the name of the class to definedef
- the byte-code definition of the new classanchorClass
- an existing class in the desired classloader- Returns:
- a newly created class
-