Package org.goplanit.io.xml.util
Class PlanitXmlJaxbParser<T>
- java.lang.Object
-
- org.goplanit.io.xml.util.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 Summary
Fields Modifier and Type Field Description static String
DEFAULT_XML_FILE_EXTENSION
Default extension for XML input files
-
Constructor Summary
Constructors Constructor Description PlanitXmlJaxbParser(Class<T> clazz)
location of where to collect XML file and populate an instance of provided classPlanitXmlJaxbParser(T xmlRootElement)
Constructor where root element is already provided and assumed to be populated as well
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearXmlContent()
mark the xml root element for garbage collectionstatic org.opengis.referencing.crs.CoordinateReferenceSystem
createPlanitCrs(String srsName)
Create a crs based on passed in srs name.T
getXmlRootElement()
Collect the root element of this readerboolean
initialiseAndParseXmlRootElement(String inputPathDirectory, String xmlFileExtension)
Parse the raw XML root (and rest) from file if not already set via constructorvoid
setXmlRootElement(T xmlRootElement)
Set the root element of this reader
-
-
-
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 usexmlFileExtension
- 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
-
-