Class PlanitXmlJaxbParser<T>


  • public class PlanitXmlJaxbParser<T>
    extends Object
    Serves as a base class for readers of PLANit XML files of which the root element is of type T
    Author:
    markr
    • Field Detail

      • DEFAULT_XML_FILE_EXTENSION

        public static final String DEFAULT_XML_FILE_EXTENSION
        Default extension for XML input files
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlanitXmlJaxbParser

        public PlanitXmlJaxbParser​(Class<T> clazz)
        location of where to collect XML file and populate an instance of provided class
        Parameters:
        clazz - to create root element and populate it for
      • PlanitXmlJaxbParser

        public PlanitXmlJaxbParser​(T xmlRootElement)
        Constructor where root element is already provided and assumed to be populated as well
        Parameters:
        xmlRootElement - to use
    • Method Detail

      • initialiseAndParseXmlRootElement

        public boolean initialiseAndParseXmlRootElement​(String inputPathDirectory,
                                                        String xmlFileExtension)
        Parse the raw XML root (and rest) from file if not already set via constructor
        Parameters:
        inputPathDirectory - to use
        xmlFileExtension - to use
        Returns:
        true when success, false when something was parsed but no appropriate match could be found
      • createPlanitCrs

        public static org.opengis.referencing.crs.CoordinateReferenceSystem createPlanitCrs​(String srsName)
        Create a crs based on passed in srs name. If no srs name is provided the default will be created
        Parameters:
        srsName - to use
        Returns:
        created crs
      • getXmlRootElement

        public T getXmlRootElement()
        Collect the root element of this reader
        Returns:
        root element
      • setXmlRootElement

        public void setXmlRootElement​(T xmlRootElement)
        Set the root element of this reader
        Parameters:
        xmlRootElement - to use
      • clearXmlContent

        public void clearXmlContent()
        mark the xml root element for garbage collection