Package org.jboss.classfilewriter
Class DefaultClassFactory
java.lang.Object
org.jboss.classfilewriter.DefaultClassFactory
- All Implemented Interfaces:
ClassFactory
Default class definition factory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final MethodHandleprivate static final MethodHandle(package private) static final ClassFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?> defineClass(ClassLoader loader, String name, byte[] b, int off, int len, ProtectionDomain domain) Converts an array of bytes into an instance of class Class.
-
Field Details
-
DEFINE_CLASS_METHOD_NAME
- See Also:
-
defineClassWithoutDomainParam
-
defineClassWithDomainParam
-
INSTANCE
-
-
Constructor Details
-
DefaultClassFactory
private DefaultClassFactory()
-
-
Method Details
-
defineClass
public Class<?> defineClass(ClassLoader loader, String name, byte[] b, int off, int len, ProtectionDomain domain) throws ClassFormatError Description copied from interface:ClassFactoryConverts an array of bytes into an instance of class Class.- Specified by:
defineClassin interfaceClassFactory- Parameters:
loader- The classloader to be used for class definition.name- The expected binary name of the class, or null if not knownb- The bytes that make up the class data. The bytes in positions off through off+len-1 should have the format of a valid class file as defined by The Java™ Virtual Machine Specification.off- The start offset in b of the class datalen- The length of the class datadomain- The ProtectionDomain of the class- Returns:
- The Class object that was created from the specified class data.
- Throws:
ClassFormatError- If the data did not contain a valid class
-