public static Method getAccessor(Class<?> declaringClass, String accessorname)
	{
		Method res = null;
		if (declaringClass != null)
		{
			// check this class
			try
			{
				res = declaringClass.getDeclaredMethod(accessorname);
			}
			catch (NoSuchMethodException e)
			{
				// do nothing, keep iterating up
			}
			if (res == null)
			{
				res = getAccessor(declaringClass.getSuperclass(), accessorname);
			}
		}

		return res;
	}