Package javassist.util.proxy
Class FactoryHelper
java.lang.Object
javassist.util.proxy.FactoryHelper
A helper class for implementing
ProxyFactory
.
The users of ProxyFactory
do not have to see this class.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int[]
The data size of primitive types.static final Class<?>[]
Class
objects representing primitive types.static final String[]
The names of methods for obtaining a primitive value from a wrapper object.static final String[]
The descriptors of the unwrapping methods contained inunwrapMethods
.static final String[]
The descriptors of the constructors of wrapper classes.static final String[]
The fully-qualified names of wrapper classes for primitive types. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>
toClass
(ClassFile cf, Class<?> neighbor, ClassLoader loader, ProtectionDomain domain) Loads a class file by a given class loader.static Class<?>
toClass
(ClassFile cf, ClassLoader loader) Deprecated.static Class<?>
toClass
(ClassFile cf, ClassLoader loader, ProtectionDomain domain) Deprecated.static Class<?>
toClass
(ClassFile cf, MethodHandles.Lookup lookup) Loads a class file by a given lookup.static final int
Returns an index for accessing arrays in this class.static void
Writes a class file.
-
Field Details
-
primitiveTypes
Class
objects representing primitive types. -
wrapperTypes
The fully-qualified names of wrapper classes for primitive types. -
wrapperDesc
The descriptors of the constructors of wrapper classes. -
unwarpMethods
The names of methods for obtaining a primitive value from a wrapper object. For example,intValue()
is such a method for obtaining an integer value from ajava.lang.Integer
object. -
unwrapDesc
The descriptors of the unwrapping methods contained inunwrapMethods
. -
dataSize
public static final int[] dataSizeThe data size of primitive types.long
anddouble
are 2; the others are 1.
-
-
Constructor Details
-
FactoryHelper
public FactoryHelper()
-
-
Method Details
-
typeIndex
Returns an index for accessing arrays in this class.- Throws:
RuntimeException
- if a given type is not a primitive type.
-
toClass
Deprecated.Loads a class file by a given class loader. This method uses a default protection domain for the class but it may not work with a security manager or a signed jar file.- Throws:
CannotCompileException
- See Also:
-
toClass
public static Class<?> toClass(ClassFile cf, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException Deprecated.Loads a class file by a given class loader.- Parameters:
loader
- The class loader. It can be null ifneighbor
is not null.domain
- if it is null, a default domain is used.- Throws:
CannotCompileException
- Since:
- 3.3
- See Also:
-
toClass
public static Class<?> toClass(ClassFile cf, Class<?> neighbor, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException Loads a class file by a given class loader.- Parameters:
neighbor
- a class belonging to the same package that the loaded class belongs to. It can be null.loader
- The class loader. It can be null ifneighbor
is not null.domain
- if it is null, a default domain is used.- Throws:
CannotCompileException
- Since:
- 3.3
-
toClass
public static Class<?> toClass(ClassFile cf, MethodHandles.Lookup lookup) throws CannotCompileException Loads a class file by a given lookup.- Parameters:
lookup
- used to define the class.- Throws:
CannotCompileException
- Since:
- 3.24
-
writeFile
Writes a class file.- Throws:
CannotCompileException
-