Package org.planit.io.network.converter
Class PlanitNetworkReader
- java.lang.Object
-
- org.planit.io.xml.util.PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicNetwork>
-
- org.planit.io.network.converter.PlanitNetworkReader
-
- All Implemented Interfaces:
NetworkReader
public class PlanitNetworkReader extends PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicNetwork> implements NetworkReader
Implementation of the network reader for the PLANit XML native format- Author:
- gman, markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
NETWORK_XSD_FILE
Default XSD files used to validate input XML files against TODO: replace with online schema
-
Constructor Summary
Constructors Constructor Description PlanitNetworkReader(String networkPathDirectory, String xmlFileExtension, InfrastructureNetwork network)
constructorPlanitNetworkReader(org.planit.xml.generated.XMLElementMacroscopicNetwork externalXmlRawNetwork, InfrastructureNetwork network)
constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanitNetworkReaderSettings
getSettings()
collect settings for this readerInfrastructureNetwork
read()
parse the network based on the configuration of the implementing class to yield a PLANit networkprotected void
setNetwork(InfrastructureNetwork network)
place network to populate-
Methods inherited from class org.planit.io.xml.util.PlanitXmlReader
clearXmlContent, getXmlRootElement, initialiseAndParseXmlRootElement
-
-
-
-
Field Detail
-
NETWORK_XSD_FILE
public static final String NETWORK_XSD_FILE
Default XSD files used to validate input XML files against TODO: replace with online schema- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlanitNetworkReader
public PlanitNetworkReader(String networkPathDirectory, String xmlFileExtension, InfrastructureNetwork network) throws PlanItException
constructor- Parameters:
networkPathDirectory
- to usexmlFileExtension
- to usenetwork
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitNetworkReader
public PlanitNetworkReader(org.planit.xml.generated.XMLElementMacroscopicNetwork externalXmlRawNetwork, InfrastructureNetwork network) throws PlanItException
constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
externalXmlRawNetwork
- to extract fromnetwork
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
setNetwork
protected void setNetwork(InfrastructureNetwork network) throws PlanItException
place network to populate- Parameters:
network
- to populate- Throws:
PlanItException
- thrown if error
-
read
public InfrastructureNetwork read() throws PlanItException
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
read
in interfaceNetworkReader
- Returns:
- parsed network
- Throws:
PlanItException
- thrown if error
-
getSettings
public PlanitNetworkReaderSettings getSettings()
collect settings for this reader- Returns:
- settings
-
-