getAllRelationships reimplemented to match only relevant relationship classes,
[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.io.common.mapping.out.IExportTransformer;
20 import eu.etaxonomy.cdm.model.common.CdmBase;
21
22 /**
23 * @author a.mueller
24 * @created 11.05.2009
25 * @version 1.0
26 */
27 public class XmlExportState<CONFIG extends XmlExportConfiguratorBase<?>> extends ExportStateBase<CONFIG, IExportTransformer> {
28 private static final Logger logger = Logger.getLogger(XmlExportState.class);
29
30 private Map<UUID, String> xmlIdMap = new HashMap<UUID, String>();
31
32
33 // /* (non-Javadoc)
34 // * @see eu.etaxonomy.cdm.io.common.IoStateBase#initialize(eu.etaxonomy.cdm.io.common.IoConfiguratorBase)
35 // */
36 // @Override
37 // public void initialize(XmlExportConfiguratorBase config) {
38 //
39 // }
40
41
42 public XmlExportState(CONFIG config) {
43 super(config);
44 }
45
46 public void putDbId(CdmBase cdmBase, String xmlId){
47 if (cdmBase != null){
48 xmlIdMap.put(cdmBase.getUuid(), xmlId);
49 }else{
50 logger.warn("CdmBase was (null) and could not be added to xmlIdMap");
51 }
52 }
53
54 public String getDbId(CdmBase cdmBase){
55 if (cdmBase != null){
56 return xmlIdMap.get(cdmBase.getUuid());
57 }else{
58 logger.warn("CdmBase was (null). No entries in xmlIdMap available");
59 return null;
60 }
61 }
62
63
64
65 }