Class ClassFields


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

      Fields 
      Modifier and Type Field Description
      private static java.util.Comparator<java.lang.reflect.Field> FIELD_NAME_ORDER_COMPARATOR
      Used to sort fields into deterministic order.
      (package private) java.util.Map<java.lang.String,​FieldTypeInfo> fieldNameToFieldTypeInfo
      Map from field name to field and resolved type.
      (package private) java.util.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.
      (package private) java.lang.reflect.Field idField
      If non-null, this is the field that has an Id annotation.
      private static java.lang.String SERIALIZATION_FORMAT_CLASS_NAME
      The name of the SerializationFormat class (used by ClassGraph to serialize a ScanResult).
      private static java.util.Comparator<java.lang.reflect.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).
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassFields​(java.lang.Class<?> cls, boolean resolveTypes, boolean onlySerializePublicFields, ClassFieldCache classFieldCache, ReflectionUtils reflectionUtils)
      Constructor.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fieldOrder

        final java.util.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 java.util.Map<java.lang.String,​FieldTypeInfo> fieldNameToFieldTypeInfo
        Map from field name to field and resolved type.
      • idField

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

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

        private static final java.util.Comparator<java.lang.reflect.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 java.lang.String SERIALIZATION_FORMAT_CLASS_NAME
        The name of the SerializationFormat class (used by ClassGraph to serialize a ScanResult).
    • Constructor Detail

      • ClassFields

        public ClassFields​(java.lang.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