Selaa lähdekoodia

PersonSectionContentsWriter

Andrew Grant 1 kuukausi sitten
vanhempi
commit
4ccdd5656a

+ 6 - 1
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/sections/PersonSectionImpl.java

@@ -8,6 +8,7 @@ package scot.carricksoftware.grantswriter.writer.latex.parts.people.sections;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grantswriter.writer.latex.parts.people.headers.PersonSectionHeader;
 import scot.carricksoftware.grantswriter.domains.people.Person;
+import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.PersonSectionContentsWriter;
 import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.PersonSubSectionReferencesWriter;
 import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.PersonSubSectionTimeLineWriter;
 import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.helpers.ClearExistingTimeLineData;
@@ -21,22 +22,26 @@ public class PersonSectionImpl implements PersonSection {
     private final PersonSubSectionReferencesWriter personSubSectionReferencesWriter;
     private final ClearExistingTimeLineData clearExistingTimeLineData;
     private final GatherTimeLineData gatherTimeLineData;
+    private final PersonSectionContentsWriter personSectionContentsWriter;
 
     public PersonSectionImpl(PersonSectionHeader personSectionHeader,
                              PersonSubSectionTimeLineWriter personSubSectionTimeLineWriter,
                              PersonSubSectionReferencesWriter personSubSectionReferencesWriter,
                              ClearExistingTimeLineData clearExistingTimeLineData,
-                             GatherTimeLineData gatherTimeLineData) {
+                             GatherTimeLineData gatherTimeLineData,
+                             PersonSectionContentsWriter personSectionContentsWriter) {
         this.personSectionHeader = personSectionHeader;
         this.personSubSectionTimeLineWriter = personSubSectionTimeLineWriter;
         this.personSubSectionReferencesWriter = personSubSectionReferencesWriter;
         this.clearExistingTimeLineData = clearExistingTimeLineData;
         this.gatherTimeLineData = gatherTimeLineData;
+        this.personSectionContentsWriter = personSectionContentsWriter;
     }
 
     @Override
     public void write(Person person) {
         personSectionHeader.write(person);
+        personSectionContentsWriter.write(person);
         clearExistingTimeLineData.clear();
         gatherTimeLineData.gather(person);
         personSubSectionTimeLineWriter.write();

+ 12 - 0
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/PersonSectionContentsWriter.java

@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections;
+
+import scot.carricksoftware.grantswriter.domains.people.Person;
+
+public interface PersonSectionContentsWriter {
+    void write(Person person);
+}

+ 23 - 0
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/PersonSectionContentsWriterImpl.java

@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grantswriter.domains.people.Person;
+
+@Component
+public class PersonSectionContentsWriterImpl implements PersonSectionContentsWriter {
+
+    private static final Logger logger = LogManager.getLogger(PersonSectionContentsWriterImpl.class);
+
+    @Override
+    public void write(Person person) {
+        logger.info("PersonSectionContentsWriterImpl.write()");
+
+    }
+}

+ 27 - 0
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/PersonSectionContentsWriterTest.java

@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+
+class PersonSectionContentsWriterTest {
+
+    private PersonSectionContentsWriter writer;
+
+    @BeforeEach
+    void setUp() {
+        writer = new PersonSectionContentsWriterImpl();
+    }
+
+    @Test
+    void constructorTest() {
+        assertNotNull(writer);
+    }
+}