public static Field[] getAllFields(Class<?> of, Class<?> upTo)
	{
		LinkedList<Class<?>> classes = new LinkedList<Class<?>>();

		while(!of.equals(upTo))
		{
			classes.offer(of);
			of = of.getSuperclass();
		}

		HashMap<String, Field> fields = new HashMap<String, Field>();

		while(!classes.isEmpty())
		{
			of = classes.poll();

			Field[] declaredFields = of.getDeclaredFields();
			for(Field f : declaredFields)
			{
				fields.put(f.getName(), f);
			}
		}

		Field[] fieldArray = new Field[fields.values().size()];

		int x = 0;
		for(Field f : fields.values())
		{
			fieldArray[x++] = f;
		}
		return fieldArray;
	}