Java Reflection Field Find findField(final Object instance, final String name)

Here you can find the source of findField(final Object instance, final String name)

Description

find Field

License

LGPL

Declaration

public static Field findField(final Object instance, final String name) 

Method Source Code


//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;
        }
    }
}

Related

  1. findField(final Class clazz, final String name, final Class type)
  2. findField(final Class cls, final String fieldName)
  3. findField(final Class currentClass, final String fieldName)
  4. findField(final Class declaringClass, final String fieldName)
  5. findField(final Class klaz, final String fieldName)
  6. findField(final Object src, final String fieldName)
  7. findField(final String className, final String fieldName)
  8. findField(Object container, String memberName)
  9. findField(Object instance, String name)