FileDocCategorySizeDatePackage
AccessOptimizerAdapter.javaAPI DocHibernate 3.2.52966Fri Feb 03 15:15:20 GMT 2006org.hibernate.bytecode.cglib

AccessOptimizerAdapter

public class AccessOptimizerAdapter extends Object implements Serializable, ReflectionOptimizer.AccessOptimizer
The {@link ReflectionOptimizer.AccessOptimizer} implementation for CGLIB which simply acts as an adpater to the {@link BulkBean} class.
author
Steve Ebersole

Fields Summary
public static final String
PROPERTY_GET_EXCEPTION
public static final String
PROPERTY_SET_EXCEPTION
private Class
mappedClass
private net.sf.cglib.beans.BulkBean
bulkBean
Constructors Summary
public AccessOptimizerAdapter(net.sf.cglib.beans.BulkBean bulkBean, Class mappedClass)


	     
		this.bulkBean = bulkBean;
		this.mappedClass = mappedClass;
	
Methods Summary
public java.lang.String[]getPropertyNames()

		return bulkBean.getGetters();
	
public java.lang.Object[]getPropertyValues(java.lang.Object object)

		try {
			return bulkBean.getPropertyValues( object );
		}
		catch ( Throwable t ) {
			throw new PropertyAccessException(
					t,
			        PROPERTY_GET_EXCEPTION,
			        false,
			        mappedClass,
			        getterName( t, bulkBean )
			);
		}
	
private static java.lang.StringgetterName(java.lang.Throwable t, net.sf.cglib.beans.BulkBean optimizer)

		if ( t instanceof BulkBeanException ) {
			return optimizer.getGetters()[( ( BulkBeanException ) t ).getIndex()];
		}
		else {
			return "?";
		}
	
private voidreadObject(java.io.ObjectInputStream in)

		Class beanClass = ( Class ) in.readObject();
		String[] getters = ( String[] ) in.readObject();
		String[] setters = ( String[] ) in.readObject();
		Class[] types = ( Class[] ) in.readObject();
		bulkBean = BulkBean.create( beanClass, getters, setters, types );
	
public voidsetPropertyValues(java.lang.Object object, java.lang.Object[] values)

		try {
			bulkBean.setPropertyValues( object, values );
		}
		catch ( Throwable t ) {
			throw new PropertyAccessException(
					t,
			        PROPERTY_SET_EXCEPTION,
			        true,
			        mappedClass,
			        setterName( t, bulkBean )
			);
		}
	
private static java.lang.StringsetterName(java.lang.Throwable t, net.sf.cglib.beans.BulkBean optimizer)

		if ( t instanceof BulkBeanException ) {
			return optimizer.getSetters()[( ( BulkBeanException ) t ).getIndex()];
		}
		else {
			return "?";
		}
	
private voidwriteObject(java.io.ObjectOutputStream out)

		out.writeObject( mappedClass );
		out.writeObject( bulkBean.getGetters() );
		out.writeObject( bulkBean.getSetters() );
		out.writeObject( bulkBean.getPropertyTypes() );