javassist.util.proxy

Class FactoryHelper

public class FactoryHelper extends Object

A helper class for implementing ProxyFactory. The users of ProxyFactory do not have to see this class.

See Also: ProxyFactory

Field Summary
static int[]dataSize
The data size of primitive types.
static Class[]primitiveTypes
Class objects representing primitive types.
static String[]unwarpMethods
The names of methods for obtaining a primitive value from a wrapper object.
static String[]unwrapDesc
The descriptors of the unwrapping methods contained in unwrapMethods.
static String[]wrapperDesc
The descriptors of the constructors of wrapper classes.
static String[]wrapperTypes
The fully-qualified names of wrapper classes for primitive types.
Method Summary
static ClasstoClass(ClassFile cf, ClassLoader loader)
Loads a class file by a given class loader.
static ClasstoClass(ClassFile cf, ClassLoader loader, ProtectionDomain domain)
Loads a class file by a given class loader.
static inttypeIndex(Class type)
Returns an index for accessing arrays in this class.
static voidwriteFile(ClassFile cf, String directoryName)
Writes a class file.

Field Detail

dataSize

public static final int[] dataSize
The data size of primitive types. long and double are 2; the others are 1.

primitiveTypes

public static final Class[] primitiveTypes
Class objects representing primitive types.

unwarpMethods

public static final String[] 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 a java.lang.Integer object.

unwrapDesc

public static final String[] unwrapDesc
The descriptors of the unwrapping methods contained in unwrapMethods.

wrapperDesc

public static final String[] wrapperDesc
The descriptors of the constructors of wrapper classes.

wrapperTypes

public static final String[] wrapperTypes
The fully-qualified names of wrapper classes for primitive types.

Method Detail

toClass

public static Class toClass(ClassFile cf, ClassLoader loader)
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 sigend jar file.

See Also: toClass

toClass

public static Class toClass(ClassFile cf, ClassLoader loader, ProtectionDomain domain)
Loads a class file by a given class loader.

Parameters: domain if it is null, a default domain is used.

Since: 3.3

typeIndex

public static final int typeIndex(Class type)
Returns an index for accessing arrays in this class.

Throws: RuntimeException if a given type is not a primitive type.

writeFile

public static void writeFile(ClassFile cf, String directoryName)
Writes a class file.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.