Top Description Methods
org.jboss.classfilewriter

public Interface ClassFactory

Known Direct Implementers
org.jboss.classfilewriter.DefaultClassFactory
Imports
java.security.ProtectionDomain

Class definition factory.
Author
Richard Opalka

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

The Class object that was created from the specified class data.
defineClass
(ClassLoader
The classloader to be used for class definition.
loader
,
String
The expected binary name of the class, or null if not known
name
,
byte[]
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.
b
,
int
The start offset in b of the class data
off
,
int
The length of the class data
len
,
ProtectionDomain
The ProtectionDomain of the class
protectionDomain
)

Converts an array of bytes into an instance of class Class.

Method Detail

defineClassback to summary
public Class<?> defineClass(ClassLoader loader, String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) throws ClassFormatError

Converts an array of bytes into an instance of class Class.

Parameters
loader:ClassLoader

The classloader to be used for class definition.

name:String

The expected binary name of the class, or null if not known

b:byte[]

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:int

The start offset in b of the class data

len:int

The length of the class data

protectionDomain:ProtectionDomain

The ProtectionDomain of the class

Returns:Class<?>

The Class object that was created from the specified class data.

Exceptions
ClassFormatError:
If the data did not contain a valid class