Returns Declared field either from given class or it's super class
@param cls
@param fieldname
@return
@throws NoSuchFieldException
4362
public static Field getField(Class cls, String fieldname) throws NoSuchFieldException
    {
        while (true)
        {
            try
            {
                return cls.getDeclaredField(fieldname);
            }
            catch (NoSuchFieldException ex)
            {
                cls = cls.getSuperclass();
                if (Object.class.equals(cls))
                {
                    throw ex;
                }
            }
            catch (SecurityException ex)
            {
                throw new IllegalArgumentException(ex);
            }
        }
    }
523002
public static Field getDeclaredField(Class<?> clz, final String fieldName) {
    for (Class<?> s = clz; s != Object.class; s = s.getSuperclass()) {
      try {
        return s.getDeclaredField(fieldName);
      } catch (NoSuchFieldException ignored) {
      }
    }
    return null;
  }
440558
public <T> T getField(String fieldName, Class<T> clazz) {
        return DPathUtils.getValue(fieldData, fieldName, clazz);
    }
664787
public static <T> T getField(Object obj, String string, Class<?> clazz, Class<T> fieldType) {
		try {
			final Field field = clazz.getDeclaredField(string);
			field.setAccessible(true);
			final Object value = field.get(obj);
			return fieldType.cast(value);
		} catch (Exception exception) {
			throw new Error(exception);
		}
	}
528893
public static Field getField(Class clazz, String fieldName)
    {
        try
        {
            return clazz.getField(fieldName);
        }
        catch (Exception ignored)
        {}
        return null;
    }
1150904
public Field field(String name) {
    for (Field field : declaredFields) {
      if (field.name().equals(name)) {
        return field;
      }
    }
    for (OneOf oneOf : oneOfs) {
      for (Field field : oneOf.fields()) {
        if (field.name().equals(name)) {
          return field;
        }
      }
    }
    return null;
  }
607779
ClassFields get(final Class<?> cls) {
        ClassFields classFields = classToClassFields.get(cls);
        if (classFields == null) {
            classToClassFields.put(cls,
                    classFields = new ClassFields(cls, resolveTypes, onlySerializePublicFields, this));
        }
        return classFields;
    }
1040450
private Field[] fields(Class<?> clazz)
    {

        Map<String, Field> fields = new HashMap<String, Field>();
        do
        {
            for (Field field : clazz.getDeclaredFields())
            {
                if (!fields.containsKey(field.getName()))
                {
                    fields.put(field.getName(), field);
                }
            }
            clazz = clazz.getSuperclass();
        }
        while (clazz != Object.class);

        return fields.values().toArray(new Field[fields.size()]);

    }
139569
public static Field[] getFieldsIgnoreCase(Class clazz, String name) throws NoSuchFieldException {
	Field[] fields = fStorage.getFields(clazz, name);
	if (fields != null) return fields;
	throw new NoSuchFieldException("there is no field with name " + name + " in object [" + Type.getName(clazz) + "]");
    }
692333
public Field getField(String fieldName) {
		final PropDesc desc = this.propMap.get(fieldName);
		return null == desc ? null : desc.getField();
	}
446608
public void getStaticField(Class<?> cls, String name) throws IOException
    {
        getStaticField(El.getField(cls, name));
    }
429734
@Override
  public final Field[] retrieveFields(final Class<?> clazz) {
    Set<Field> fieldsSet = new HashSet<Field>();
    for (Field fld : clazz.getDeclaredFields()) {
      int modifiersMask = fld.getModifiers();
      if ((modifiersMask & Modifier.PRIVATE) > 0
            && (modifiersMask & Modifier.STATIC) == 0) {
        fieldsSet.add(fld);
      }
    }
    final Class<?> superClazz = clazz.getSuperclass();
    if (superClazz != null && superClazz != java.lang.Object.class) {
      for (Field fld : retrieveFields(superClazz)) {
        fieldsSet.add(fld);
      }
    }
    return fieldsSet.toArray(new Field[fieldsSet.size()]);
  }
1198608
public Reflect get(@NonNull String fieldName) throws ReflectionException {
      Field f = getField(fieldName);

      if (f == null) {
         throw new ReflectionException(new NoSuchFieldException(fieldName + " is not a valid field for " + clazz));
      }

      boolean isAccessible = f.isAccessible();
      try {
         if (accessAll) {
            f.setAccessible(true);
         }
         return onObject(f.get(object));
      } catch (IllegalAccessException e) {
         e.printStackTrace();
         throw new ReflectionException(e);
      } finally {
         f.setAccessible(isAccessible);
      }

   }
344578
public static Optional<Field> resolveField(Class<?> someClass, String fieldName) {
        return fieldCache.get(new FieldReference(someClass, fieldName));
    }
1036588
protected HashMap getFieldMap(Class cl)
    {
        HashMap fieldMap = new HashMap();

        for (; cl != null; cl = cl.getSuperclass()) {
            Field[] fields = cl.getDeclaredFields();
            for (int i = 0; i < fields.length; i++) {
                Field field = fields[i];

                if (Modifier.isTransient(field.getModifiers()) ||
                    Modifier.isStatic(field.getModifiers()))
                    continue;

                // XXX: could parameterize the handler to only deal with public
                field.setAccessible(true);

                fieldMap.put(field.getName(), field);
            }
        }

        return fieldMap;
    }
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
869171
public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException {
		
		Field field = null;
		for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) {
			try {
				field = acls.getDeclaredField(fieldName);
				break;
			} catch (NoSuchFieldException e) {
				// ignore
			}
		}
		if (field == null) {
			throw new NoSuchFieldException("Could not find field '" + fieldName + "' in class '" + clazz.getName() + "' or its super classes");
		}
		
		return field;
	}