Object change mapper for PESI and empty epithet bugfix and empty hybrid formula bugfix
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / common / XmlExportState.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.io.common;
12
13 import java.util.HashMap;
14 import java.util.Map;
15 import java.util.UUID;
16
17 import org.apache.log4j.Logger;
18
19 import eu.etaxonomy.cdm.model.common.CdmBase;
20
21 /**
22 * @author a.mueller
23 * @created 11.05.2009
24 * @version 1.0
25 */
26 public class XmlExportState<CONFIG extends XmlExportConfiguratorBase> extends ExportStateBase<CONFIG> {
27 private static final Logger logger = Logger.getLogger(XmlExportState.class);
28
29 private Map<UUID, String> xmlIdMap = new HashMap<UUID, String>();
30
31
32 // /* (non-Javadoc)
33 // * @see eu.etaxonomy.cdm.io.common.IoStateBase#initialize(eu.etaxonomy.cdm.io.common.IoConfiguratorBase)
34 // */
35 // @Override
36 // public void initialize(XmlExportConfiguratorBase config) {
37 //
38 // }
39
40
41 public XmlExportState(CONFIG config) {
42 super(config);
43 }
44
45 public void putDbId(CdmBase cdmBase, String xmlId){
46 if (cdmBase != null){
47 xmlIdMap.put(cdmBase.getUuid(), xmlId);
48 }else{
49 logger.warn("CdmBase was (null) and could not be added to xmlIdMap");
50 }
51 }
52
53 public String getDbId(CdmBase cdmBase){
54 if (cdmBase != null){
55 return xmlIdMap.get(cdmBase.getUuid());
56 }else{
57 logger.warn("CdmBase was (null). No entries in xmlIdMap available");
58 return null;
59 }
60 }
61
62
63
64 }