Package org.planit.io.xml.util
Class PlanitXmlReader<T>
- java.lang.Object
-
- org.planit.io.xml.util.PlanitXmlReader<T>
-
- Direct Known Subclasses:
PlanitDemandsReader
,PlanitInterModalReader
,PlanitNetworkReader
,PlanitZoningReader
public class PlanitXmlReader<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
-
-
Constructor Summary
Constructors Constructor Description PlanitXmlReader(Class<T> clazz, String networkPathDirectory, String xmlFileExtension)
location of where to collect Xml file and poopulate an instance of provided classPlanitXmlReader(T xmlRootElement)
Constructor where root element is already provided and assumed to be populated as well
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearXmlContent()
mark the xml root element for garbage collectionprotected T
getXmlRootElement()
Collect the root element of this readerprotected T
initialiseAndParseXmlRootElement()
parse the raw XML root (and rest) from file if not already set via constructor
-
-
-
Constructor Detail
-
PlanitXmlReader
public PlanitXmlReader(Class<T> clazz, String networkPathDirectory, String xmlFileExtension)
location of where to collect Xml file and poopulate an instance of provided class- Parameters:
clazz
- to create root element and populate it fornetworkPathDirectory
- directory on where to find the filexmlFileExtension
- xml extension to use
-
PlanitXmlReader
public PlanitXmlReader(T xmlRootElement)
Constructor where root element is already provided and assumed to be populated as well- Parameters:
xmlRootElement
- to use
-
-
Method Detail
-
initialiseAndParseXmlRootElement
protected T initialiseAndParseXmlRootElement() throws PlanItException
parse the raw XML root (and rest) from file if not already set via constructor- Returns:
- populated xml root element if possible based on provided input to constructor
- Throws:
PlanItException
- thrown if error
-
getXmlRootElement
protected T getXmlRootElement()
Collect the root element of this reader- Returns:
- root element
-
clearXmlContent
public void clearXmlContent()
mark the xml root element for garbage collection
-
-