private static Field findDeclaredField(Class<?> inClass, String fieldname)
		throws NoSuchFieldException {
		while (!Object.class.equals(inClass)) {
			for (Field field : inClass.getDeclaredFields()) {
				if (field.getName().equalsIgnoreCase(fieldname)) {
					return field;
				}
			}
			inClass = inClass.getSuperclass();
		}
		throw new NoSuchFieldException();
	}