Here you can find the source of findField(String fieldName, ArrayList
public static Field findField(String fieldName, ArrayList<Field> fields)
//package com.java2s; import java.lang.reflect.Field; import java.util.ArrayList; public class Main { public static Field findField(String fieldName, ArrayList<Field> fields) { for (Field field : fields) { if (field.getName().equals(fieldName)) { return field; }//from w w w . j av a2 s . co m } return null; } }