Here you can find the source of findField(Class> clazz, String fieldName)
public static Field findField(Class<?> clazz, String fieldName)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Field; public class Main { public static Field findField(Class<?> clazz, String fieldName) { for (Field field : clazz.getDeclaredFields()) { if (field.getName().equals(fieldName)) return field; }/*w w w. j a v a 2 s. c o m*/ return null; } }