Package org.goplanit.converter
Class Converter<T>
- java.lang.Object
-
- org.goplanit.converter.ConverterBase
-
- org.goplanit.converter.Converter<T>
-
- Type Parameters:
T
- planit entity to convert
- Direct Known Subclasses:
DemandsConverter
,NetworkConverter
,ServiceNetworkConverter
,ZoningConverter
public abstract class Converter<T> extends ConverterBase
Convert PLANit entities parsed by a reader from one format and persisted with a writer to another- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Converter(ConverterReader<T> reader, ConverterWriter<T> writer)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convert()
Convert the reader's parsed content by passing it on to the writer.protected T
read()
protected void
write(T readEntity)
-
Methods inherited from class org.goplanit.converter.ConverterBase
getReader, getWriter
-
-
-
-
Constructor Detail
-
Converter
protected Converter(ConverterReader<T> reader, ConverterWriter<T> writer)
constructor- Parameters:
reader
- to use for parsingwriter
- to use for persisting
-
-
Method Detail
-
read
protected T read()
-
write
protected void write(T readEntity) throws PlanItException
- Throws:
PlanItException
-
convert
public void convert() throws PlanItException
Convert the reader's parsed content by passing it on to the writer. It is assumed both reader and writer are fully configured when this method is called- Specified by:
convert
in classConverterBase
- Throws:
PlanItException
- thrown if error
-
-