Returns fields annotated with the clazz

@param clazz The Annotation to find.
@return the list of fields
335490
public List<MappedField> getFieldsAnnotatedWith(final Class<? extends Annotation> clazz) {
        final List<MappedField> results = new ArrayList<MappedField>();
        for (final MappedField mf : persistenceFields) {
            if (mf.hasAnnotation(clazz)) {
                results.add(mf);
            }
        }
        return results;
    }
300625
public static Field[] getAllFields(Class<?> clz) {
    List<Field> list = new ArrayList<>();
    do {
      list.addAll(Arrays.asList(clz.getDeclaredFields()));
    } while ((clz = clz.getSuperclass()) != null);
    return list.toArray(new Field[list.size()]);
  }
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;
  }
1028176
private static Class<?>[] getFields(Class<?> clz)
   {
      List<Class<?>> result = new ArrayList<Class<?>>();

      Class<?> c = clz;
      while (!c.equals(Object.class))
      {
         try
         {
            Field[] fields = SecurityActions.getDeclaredFields(c);
            if (fields.length > 0)
            {
               for (Field f : fields)
               {
                  Class<?> defClz = f.getType();
                  String defClzName = defClz.getName();

                  if (!defClz.isPrimitive() && !defClz.isArray() && 
                      !defClzName.startsWith("java") && !defClzName.startsWith("javax") && !result.contains(defClz))
                  {
                     if (trace)
                        log.tracef("Adding field: %s", defClzName);
                     
                     result.add(defClz);
                  }
               }
            }
         }
         catch (Throwable t)
         {
            // Ignore
         }

         c = c.getSuperclass();
      }

      return result.toArray(new Class<?>[result.size()]);
   }
500434
public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
		List<Method> result = new ArrayList<>();
		while (clazz != null) {
			Method[] methods = clazz.getDeclaredMethods();
			Collections.addAll(result, methods);
			clazz = clazz.getSuperclass();
		}
		return result;
	}
16583
public static List<Field> getAllFields(Class<?> clazz) {
        final List<Field> ret = new ArrayList<>();
        do {
            ret.addAll(Arrays.asList(clazz.getDeclaredFields()));
            clazz = clazz.getSuperclass();
        } while (clazz != null);
        return ret;
    }
159722
public static Field[] getNonSyntheticFields(final Class<?> clazz) {
        final List<Field> fieldList = new ArrayList<>();
        addFields(fieldList, clazz, true);

        return fieldList.toArray(new Field[fieldList.size()]);
    }
1284892
protected List<Field> getSingleLevelOfFields(Class<?> clazz) {
        List<Field> fields = new ArrayList<Field>();
        for (Field field : clazz.getDeclaredFields()) {
            if (!field.isAnnotationPresent(Inject.class)) {
                continue;
            }
            fields.add(field);
        }
        return fields;
    }
341775
public static List<Method> getAccessors(Class<?> clazz) {
    if (clazz == null) {
      throw new IllegalArgumentException("The 'clazz' parameter cannot be null.");
    }

    List<Method> methods = new ArrayList<>();
    for (Method method : clazz.getMethods()) {
      String methodName = method.getName();
      if (!"getClass".equals(methodName) && !"hashCode".equals(methodName) && method.getReturnType() != null
          && !Void.class.equals(method.getReturnType()) && method.getParameterTypes().length == 0
          && ((methodName.startsWith("get") && methodName.length() > 3)
              || (methodName.startsWith("is") && methodName.length() > 2)
              || (methodName.startsWith("has") && methodName.length() > 3))) {
        methods.add(method);
      }
    }

    // Order the methods alphabetically by name
    sort(methods, new Comparator<Method>() {
      /**
       * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
       */
      @Override
      public int compare(Method method1, Method method2) {
        return method1.getName().compareTo(method2.getName());
      }
    });

    return unmodifiableList(methods);
  }
1262284
public static Field[] getAllFields(final Class<?> clazz) {
        final List<Field> allFields = new ArrayList<>();
        addFields(allFields, clazz);
        return allFields.toArray(new Field[allFields.size()]);
    }
184125
public static List<Field> findFields(final Class<?> clazz) {
        List<Field> foundFields = new ArrayList<>();
        Class<?> searchType = clazz;
        while (!Object.class.equals(searchType) && (searchType != null)) {
            Field[] fields = searchType.getDeclaredFields();
            for (Field field : fields) {
                field.setAccessible(true);
                foundFields.add(field);
            }
            searchType = searchType.getSuperclass();
        }
        return foundFields;
    }
461592
public <T extends BaseNlpEntity> List<T> getEntities(Class<T> clazz) {
    List<BaseNlpEntity> resultList = new ArrayList<>();
    for (BaseNlpEntity item : getEntities()) {
      if (item.getClass().equals(clazz)) {
        resultList.add(item);
      }
    }
    return (List<T>) resultList;
  }
501527
public static Field[] getAllFields(Class<?> clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("You must specify the class that contains the fields");
        }
        Set<Field> fields = new LinkedHashSet<Field>();

        Class<?> thisType = clazz;

        while (thisType != null) {
            final Field[] declaredFields = thisType.getDeclaredFields();
            for (Field field : declaredFields) {
                field.setAccessible(true);
                fields.add(field);
            }
            thisType = thisType.getSuperclass();
        }
        return fields.toArray(new Field[fields.size()]);
    }
21604
public static <T extends Annotation> Set<Field> getAnnotatedPublicFields(Class<? extends Object> clazz,
			Class<T> annotation) {

		if (Object.class.equals(clazz)) {
			return Collections.emptySet();
		}

		Set<Field> annotatedFields = new HashSet<Field>();
		Field[] fields = clazz.getFields();

		for (Field field : fields) {
			if (field.getAnnotation(annotation) != null) {
				annotatedFields.add(field);
			}
		}

		return annotatedFields;
	}
900493
public static Field[] findFields(Class<?> clazz) throws IllegalAccessException {
        final List<Field> fieldList = new ArrayList<Field>();

        doWithDeclaredFields(clazz, new FieldCallback() {
            public void doWith(Field field) {
                fieldList.add(field);
            }
        });
        return fieldList.toArray(new Field[fieldList.size()]);
    }
813535
public static List<String> getNames(Class<? extends Enum<?>> clazz) {
		final Enum<?>[] enums = clazz.getEnumConstants();
		if (null == enums) {
			return null;
		}
		final List<String> list = new ArrayList<>(enums.length);
		for (Enum<?> e : enums) {
			list.add(e.name());
		}
		return list;
	}
1321888
public Field[] getFields(Class clazz, String fieldname) {
	Struct fieldMap;
	Object o;
	synchronized (map) {
	    o = map.get(clazz);
	    if (o == null) {
		fieldMap = store(clazz);
	    }
	    else fieldMap = (Struct) o;
	}
	o = fieldMap.get(fieldname, null);
	if (o == null) return null;
	return (Field[]) o;

    }