Here you can find the source of findField(final Object instance, final String name)
public static Field findField(final Object instance, final String name)
//package com.java2s; //License from project: LGPL import java.lang.reflect.Field; public class Main { public static Field findField(final Object instance, final String name) { try {//from w w w . java2 s.c o m return instance.getClass().getField(name); } catch (NoSuchFieldException e) { return null; } } }