package au.gov.ga.geodesy.support.mapper.dozer.populator;

import au.gov.xml.icsm.geodesyml.v_0_3.GnssAntennaType;

/**
 * The receivers have required elements that don't all exist in the SOPAC Sitelog xml. This fills them in.
 * Note that it isn't possible to do every element as they will have complex element hierarchies.
 * 
 * @author brookes
 *
 */
public class GeodesyMLDozerEventListener_GnssAntennaType extends GeodesyMLElementPopulator<GnssAntennaType> {
    /**
     * Consider all required elements for this type and add any missing ones with default values.
     * 
     * @param gnssReceiverType
     */
    void checkAllRequiredElementsPopulated(GnssAntennaType gnssAntennaType) {
        // This can be blank when receiver hasn't been removed. Some other logic in the project
        // removes empty elements from the Sopac SiteLog before it gets to this translator
        checkElementPopulated(gnssAntennaType, "antennaCableType", getBlankAntennaCableType());
    }

    private String getBlankAntennaCableType() {
        return "";
    }
}

@@ -63,51 +63,162 @@
 ort 
-au.gov.xml.icsm.geodesyml.v_0_3.GnssAntenna
+java.util.Arrays;%0Aimport java.util.stream.Collectors;%0A%0Aimport au.gov.xml.icsm.geodesyml.v_0_3.GnssAntennaType;%0Aimport net.opengis.gml.v_3_2_1.TimePosition
 Type
@@ -1061,84 +1061,468 @@
  get
-BlankAntennaCableType());%0A    %7D%0A%0A    private String getBlankAntennaCableType
+EmptyString());%0A        checkElementPopulated(gnssAntennaType, %22radomeSerialNumber%22, getEmptyString());%0A        checkElementPopulated(gnssAntennaType, %22dateRemoved%22, getEmptyTimePositionType());%0A    %7D%0A%0A    private TimePositionType getEmptyTimePositionType() %7B%0A        TimePositionType tpt = new TimePositionType();%0A        tpt.setValue(Arrays.stream(new String%5B%5D %7B%22%22%7D).collect(Collectors.toList()));%0A        return tpt;%0A    %7D%0A%0A    private String getEmptyString
 () %7B

Make Antenna elements optional