This Java project was created as part of a university assignment. It reads family data from a CSV file, processes it, and generates a visual family tree diagram in PlantUML format. The program supports multiple validation checks for realistic family relationships, including lifespan, age constraints, and parent-child relationships.
- CSV File Parsing: Reads family member data from a CSV file.
- Error Checking: Validates relationships with custom exceptions like
NegativeLifespanException,AmbiguousPersonException, andParentingAgeException. - PlantUML Integration: Converts the data into PlantUML syntax and generates a visual diagram of the family tree.
- Customizable Output: Allows you to set the output directory and file name for the generated diagram.
- Main Class: Manages the workflow, from reading the CSV to generating the UML file.
- Person Class: Represents each individual in the family tree and provides methods for CSV parsing and PlantUML syntax generation.
- PlantUMLRunner: Runs PlantUML to generate the diagram file from the PlantUML syntax.
- Set the
filePathvariable inMainto the location of your CSV file containing the family data. - Specify the
outputDirandoutputNamefor the generated PlantUML file. - Run the
Mainclass to generate the UML diagram. - View the resulting diagram in a compatible PlantUML viewer.
The CSV file should include columns for each person’s name, birth and death years, and parent-child relationships, for example:
name,birthYear,deathYear,parent1,parent2
Alice,1920,1990,,
Bob,1945,,
Carol,1970,,- Java 8 or higher
- PlantUML jar file (set in runner.setPlantUmlFilePath in Main)
If you’d like to reach out, feel free to connect with me:
Thanks for visiting!