Package studentrepoloader.model.villecsv.mapper


package studentrepoloader.model.villecsv.mapper
Defines the interface and mapping logic for structured ViLLe submission objects.

This package provides type-safe abstractions and a reflection-based mapping utility to convert raw parsed CSV rows into typed submission objects.

Core interfaces:

  • VilleSubmissionFields – Base interface for all ViLLe submission records. Defines core fields like email, names, timestamp, and student ID.
  • GitLabSubmissionFields – Extension of VilleSubmission for submissions that include a GitLab repository URL and metadata about AI use and group work.

Core mapper:

  • SubmissionMapper – Uses reflection to instantiate a VilleSubmission implementation from each parsed CSV row. All mapped classes must define a constructor with the signature (String[] row, ViLLeCsvFile source).

The mapper layer delegates validation to the constructors of the target implementation classes. By enforcing a consistent constructor signature, it enables plug-and-play support for custom submission models without modifying upstream parsing logic.

Example usage:

     ViLLeCsvFile csv = new ViLLeCsvFile(file);
     SubmissionMapper mapper = new SubmissionMapperinvalid input: '<'>(csv, DefaultGitLabSubmission.class);
     List submissions = mapper.getSubmissionList();
 

This package enables a clean separation between format parsing and data semantics.