Class CollectionElementCreationService

java.lang.Object
ru.objectsfill.service.CollectionElementCreationService

public class CollectionElementCreationService extends Object
The CollectionElementCreationService class is responsible for generating collection elements based on the field type and the Fill object provided. It utilizes a container that holds mappings between collection types and their respective CollectionTypeFill implementations.
  • Constructor Details

    • CollectionElementCreationService

      public CollectionElementCreationService()
      Constructs a new CollectionElementCreationService and initializes the container by searching for local container implementations and adding default mappings.
  • Method Details

    • generateCollection

      public Object generateCollection(Field field, Fill fill)
      Generates a collection based on the provided field and Fill object. Determines the element type of the collection, retrieves the appropriate CollectionTypeFill implementation, and delegates the generation to that implementation.
      Parameters:
      field - The field for which the collection is being generated.
      fill - The Fill object containing the necessary information for generation.
      Returns:
      The generated collection.
    • getTypeClass

      public static Class<?> getTypeClass(Field field, Fill fill)
      Retrieves the class of the field's type, taking into account generic types defined in Fill object.
      Parameters:
      field - The field for which the type class is being retrieved.
      fill - The Fill object containing the generic type information.
      Returns:
      The class representing the field's type.