指定したクラスの持つ全てのフィールドを親クラスを含めて取得する

@param cls 型
@return {@literal Set<Field>ｊ}
557890
public static Collection<Field> fields(final Class<?> cls) {
		Map<String, Field> fieldMap = new HashMap<>();
		walkFields(cls, fieldMap);
		return fieldMap.values();
	}
401575
public static <T> Collection<T> findAmongst(Class<T> clazz, Object ... instances) {
    return findAmongst(clazz, Arrays.asList(instances));
  }
1239516
public Set<Field> getFields(boolean privileged) {
      if (privileged) {
         return Collections.unmodifiableSet(Sets.union(fields, declaredFields));
      } else {
         return Collections.unmodifiableSet(fields);
      }
   }
316313
public static Field[] getAllFields(final Class<?> cls) {
        final List<Field> allFieldsList = getAllFieldsList(cls);
        return allFieldsList.toArray(new Field[allFieldsList.size()]);
    }
1058005
public Serializer getSerializer(Class cls) {
    SerializerWrapper w = getSerializerWrapper(cls);
    if (w != null) {
      return w.serializer;
    }
    return null;
  }
520971
private Map<Field, Bind> bfields(@NonNull final Class<?> klass) {
        Map<Field, Bind> value = bfields.get(klass);
        if (value == null) {
            value = fields(klass, Bind.class);
            for (Field field : value.keySet()) {
                if (!field.isAccessible()) {
                    field.setAccessible(true);
                }
            }
            bfields.put(klass, unmodifiableMap(value));
        }
        return value;
    }
21220
public static Set<Field> getAllStaticFields(Class<?> type) {
        final Set<Field> fields = new LinkedHashSet<Field>();
        final Field[] declaredFields = type.getDeclaredFields();
        for (Field field : declaredFields) {
            if (Modifier.isStatic(field.getModifiers())) {
                field.setAccessible(true);
                fields.add(field);
            }
        }
        return fields;
    }
574838
@SuppressWarnings("unchecked")
    public <T> Set<T> getSet(Class<T> clazz) {
        return (Set<T>) objects;
    }
688445
@SuppressWarnings("unchecked")
    public static <T> SimpleExpression<T> set(Class<T> clazz, SimpleExpression<?>... exprs) {
        SimpleExpression<T> rv = (SimpleExpression<T>) exprs[0];
        for (int i = 1; i < exprs.length; i++) {
            rv = new SimpleOperation<T>(clazz, Ops.SET, rv, exprs[i]);
        }
        return rv;
    }
644472
public static Object getFieldInstance(List chids, Field f)
    {

        if (Set.class.isAssignableFrom(f.getType()))
        {
            Set col = new HashSet(chids);
            return col;
        }
        return chids;
    }
1147878
protected HashMap<String, FieldDeserializer> getFieldMap(Class cl)
    {
        HashMap<String, FieldDeserializer> fieldMap = new HashMap<String, FieldDeserializer>();

        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;
                else if (fieldMap.get(field.getName()) != null)
                    continue;

                // XXX: could parameterize the handler to only deal with public
                try {
                    field.setAccessible(true);
                } catch (Throwable e) {
                    e.printStackTrace();
                }

                Class<?> type = field.getType();
                FieldDeserializer deser;

                if (String.class.equals(type))
                    deser = new StringFieldDeserializer(field);
                else if (byte.class.equals(type)) {
                    deser = new ByteFieldDeserializer(field);
                }
                else if (short.class.equals(type)) {
                    deser = new ShortFieldDeserializer(field);
                }
                else if (int.class.equals(type)) {
                    deser = new IntFieldDeserializer(field);
                }
                else if (long.class.equals(type)) {
                    deser = new LongFieldDeserializer(field);
                }
                else if (float.class.equals(type)) {
                    deser = new FloatFieldDeserializer(field);
                }
                else if (double.class.equals(type)) {
                    deser = new DoubleFieldDeserializer(field);
                }
                else if (boolean.class.equals(type)) {
                    deser = new BooleanFieldDeserializer(field);
                }
                else if (java.sql.Date.class.equals(type)) {
                    deser = new SqlDateFieldDeserializer(field);
                }
                else if (java.sql.Timestamp.class.equals(type)) {
                    deser = new SqlTimestampFieldDeserializer(field);
                }
                else if (java.sql.Time.class.equals(type)) {
                    deser = new SqlTimeFieldDeserializer(field);
                }
                else {
                    deser = new ObjectFieldDeserializer(field);
                }

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

        return fieldMap;
    }
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()]);
   }
282536
protected FieldDescriptor[] buildFieldsForSelect(ClassDescriptor cld)
    {
        DescriptorRepository repository = cld.getRepository();
        Set fields = new ListOrderedSet();   // keep the order of the fields
        
        // add Standard Fields
        // MBAIRD: if the object being queried on has multiple classes mapped to the table,
        // then we will get all the fields that are a unique set across all those classes so if we need to
        // we can materialize an extent
        FieldDescriptor fds[] = repository.getFieldDescriptorsForMultiMappedTable(cld);
        for (int i = 0; i < fds.length; i++)
        {
            fields.add(fds[i]);
        }

        // add inherited Fields. This is important when querying for a class having a super-reference
        fds = cld.getFieldDescriptor(true);
        for (int i = 0; i < fds.length; i++)
        {
            fields.add(fds[i]);
        }

        // add Fields of joined subclasses
        Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld, true);
        for (int c = 0; c < multiJoinedClasses.length; c++)
        {
            ClassDescriptor subCld = repository.getDescriptorFor(multiJoinedClasses[c]);
            fds = subCld.getFieldDescriptions();
            for (int i = 0; i < fds.length; i++)
            {
                fields.add(fds[i]);
            }
        }

        FieldDescriptor[] result = new FieldDescriptor[fields.size()];
        fields.toArray(result);
        return result;
    }
156223
public static Field[] jlClassGetFields(Class<?> clazz) {
		ReloadableType rtype = getRType(clazz);
		if (rtype == null) {
			return clazz.getFields();
		}
		else {
			List<Field> allFields = new ArrayList<Field>();
			gatherFields(clazz, allFields, new HashSet<Class<?>>());
			return allFields.toArray(new Field[allFields.size()]);
		}
	}
72081
@SuppressWarnings("unchecked")
    public <T> T getProperty(String key, Class<T> cls) {
        if (properties != null) {
            if (cls != null && cls != Object.class && cls != String.class
                    && !cls.isInterface() && !cls.isArray()) {
                // engine.getProperty("loaders", ClasspathLoader.class);
                key = key + "=" + cls.getName();
            }
            Object value = properties.get(key);
            if (value != null) {
                if (cls == String.class && value.getClass() != String.class) {
                    return (T) value.getClass().getName();
                }
                return (T) value;
            }
        }
        return null;
    }
1066436
Object getObjectFromConstantFields(Class cls) {
		Field[] fields = cls.getFields();
		Object instance = null;
		for (Field field : fields) {
			instance = getObjectFromConstantField(cls, field);
			if(instance!=null) {
				break;
			}
		}
		return instance;
	}
1260025
public Set<String> keySet() throws IOException {
    Set<String> ret = new HashSet<>();
    JsonParser p = this.getParser();
    JsonToken t;

    t = p.nextToken();

    while (t != null) {
      if (t == JsonToken.FIELD_NAME) {
        ret.add(p.getCurrentName());
      }
      t = p.nextToken();
    }
    p.close();
    return ret;
  }