MATSIM
PopulationWriterHandler.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * PlansWriterHandler.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.population.io;
22 
23 import java.io.BufferedWriter;
24 import java.io.IOException;
25 import java.util.Map;
26 
27 import org.apache.logging.log4j.LogManager;
31 
35 public interface PopulationWriterHandler {
36 
37  void writeHeaderAndStartElement(BufferedWriter out) throws IOException;
38 
39  void startPlans(final Population plans, final BufferedWriter out) throws IOException;
40 
41  void writePerson(final Person person, final BufferedWriter out) throws IOException;
42 
43  void endPlans(final BufferedWriter out) throws IOException;
44 
45  void writeSeparator(final BufferedWriter out) throws IOException;
46 
47  default void putAttributeConverters(Map<Class<?>, AttributeConverter<?>> converters) {
48  if (!converters.isEmpty()) {
49  LogManager.getLogger(getClass()).warn(
50  getClass().getName() +
51  " does not support custom attributes." +
52  " Please use a more recent file format" +
53  " if you need this feature.");
54  }
55  }
56 }
void writePerson(final Person person, final BufferedWriter out)
default void putAttributeConverters(Map< Class<?>, AttributeConverter<?>> converters)
void startPlans(final Population plans, final BufferedWriter out)