/*
 * Created on Aug 2, 2005
 * 
 * $Log$
 * Revision 1.2  2005/09/21 22:00:45  dsowen
 * Split out the access stuff into accesslib.
 * New Creator interface off-loads object creation to user.
 *
 * Revision 1.1  2005/08/03 00:35:29  dsowen
 * Initial commit.
 *
 */
package ws.fugue88.jpath;

import java.lang.reflect.InvocationTargetException;

import ws.fugue88.access.Accessor;

/**
 * @author dsowen
 */
public class PropertyAccessor implements Accessor {

	public Class getType()
	{
		return _prop.getType();
	}

	public void clearValue() throws InvocationTargetException
	{
		_prop.setValue(_that, null);
	}

	public Object getValue() throws InvocationTargetException
	{
		return _prop.getValue(_that);
	}

	public void setValue(final Object value) throws InvocationTargetException
	{
		_prop.setValue(_that, value);
	}

	PropertyAccessor(final Object that, final Property property)
	{
		_that = that;
		_prop = property;
	}

	private final Object _that;
	private final Property _prop;
}