code: private static Field[] getAllFields(Object delegate) {
  		
  		ArrayList<Field> fields = new ArrayList<Field>(Arrays.asList(delegate.getClass()
  				.getDeclaredFields()));
  		Class superClass = delegate.getClass().getSuperclass();
  		while(superClass != null){
  		
  		if (superClass != null) {
  			Field[] parentFields = superClass.getDeclaredFields();
  			if (parentFields.length != 0) {
  				fields.addAll(Arrays.asList(superClass
  						.getDeclaredFields()));
  			}
  			
  		}
  		superClass = superClass.getSuperclass();
  		}
  		return fields.toArray(new Field[fields.size()]);
  
  	}
docs: /*
  @param delegate
  An instance of the batch artifact
  @return An array of fields containing all declared fields and visible parent fields