FileDocCategorySizeDatePackage
DirectPropertyAccessor.javaAPI DocHibernate 3.2.54134Sun Apr 15 07:50:34 BST 2007org.hibernate.property

DirectPropertyAccessor

public class DirectPropertyAccessor extends Object implements PropertyAccessor
Accesses fields directly.
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
private static java.lang.reflect.FieldgetField(java.lang.Class clazz, java.lang.String name)

		if ( clazz==null || clazz==Object.class ) {
			throw new PropertyNotFoundException("field not found: " + name); 
		}
		Field field;
		try {
			field = clazz.getDeclaredField(name);
		}
		catch (NoSuchFieldException nsfe) {
			field = getField( clazz, clazz.getSuperclass(), name );
		}
		if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true);
		return field;
	
private static java.lang.reflect.FieldgetField(java.lang.Class root, java.lang.Class clazz, java.lang.String name)

		if ( clazz==null || clazz==Object.class ) {
			throw new PropertyNotFoundException("field [" + name + "] not found on " + root.getName()); 
		}
		Field field;
		try {
			field = clazz.getDeclaredField(name);
		}
		catch (NoSuchFieldException nsfe) {
			field = getField( root, clazz.getSuperclass(), name );
		}
		if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true);
		return field;
	
public GettergetGetter(java.lang.Class theClass, java.lang.String propertyName)

		return new DirectGetter( getField(theClass, propertyName), theClass, propertyName );
	
public SettergetSetter(java.lang.Class theClass, java.lang.String propertyName)

		return new DirectSetter( getField(theClass, propertyName), theClass, propertyName );