Class ClassFields

java.lang.Object
nonapi.io.github.classgraph.json.ClassFields

class ClassFields extends Object
The list of fields that can be (de)serialized (non-final, non-transient, non-synthetic, accessible), and their corresponding resolved (concrete) types.
  • Field Details

    • fieldOrder

      final List<FieldTypeInfo> fieldOrder
      The list of fields that can be (de)serialized (non-final, non-transient, non-synthetic, accessible), and their corresponding resolved (concrete) types.

      For arrays, the Type will be a Class<?> reference where Class.isArray() is true, and Class.getComponentType() is the element type (the element type will itself be an array-typed Class<?> reference for multi-dimensional arrays).

      For generics, the Type will be an implementation of ParameterizedType.

    • fieldNameToFieldTypeInfo

      final Map<String,FieldTypeInfo> fieldNameToFieldTypeInfo
      Map from field name to field and resolved type.
    • idField

      Field idField
      If non-null, this is the field that has an Id annotation.
    • FIELD_NAME_ORDER_COMPARATOR

      private static final Comparator<Field> FIELD_NAME_ORDER_COMPARATOR
      Used to sort fields into deterministic order.
    • SERIALIZATION_FORMAT_FIELD_NAME_ORDER_COMPARATOR

      private static final Comparator<Field> SERIALIZATION_FORMAT_FIELD_NAME_ORDER_COMPARATOR
      Used to sort fields into deterministic order for SerializationFormat class (which needs to have "format" field in first position for ClassGraph's serialization format) (#383).
    • SERIALIZATION_FORMAT_CLASS_NAME

      private static final String SERIALIZATION_FORMAT_CLASS_NAME
      The name of the SerializationFormat class (used by ClassGraph to serialize a ScanResult).
  • Constructor Details

    • ClassFields

      public ClassFields(Class<?> cls, boolean resolveTypes, boolean onlySerializePublicFields, ClassFieldCache classFieldCache, ReflectionUtils reflectionUtils)
      Constructor.
      Parameters:
      cls - the class
      resolveTypes - whether to resolve types
      onlySerializePublicFields - whether to only serialize public fields
      classFieldCache - the class field cache