Project

General

Profile

Download (1.38 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.io.common;
11

    
12
import java.io.File;
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
 * @since 11.05.2009
25
 */
26
public class XmlExportState<CONFIG extends XmlExportConfiguratorBase<?>>
27
            extends ExportStateBase<CONFIG, IExportTransformer, File> {
28

    
29
    private static final Logger logger = Logger.getLogger(XmlExportState.class);
30

    
31
	private Map<UUID, String> xmlIdMap = new HashMap<>();
32

    
33

    
34
	public XmlExportState(CONFIG config) {
35
		super(config);
36
	}
37

    
38
	public void putDbId(CdmBase cdmBase, String xmlId){
39
		if (cdmBase != null){
40
			xmlIdMap.put(cdmBase.getUuid(), xmlId);
41
		}else{
42
			logger.warn("CdmBase was (null) and could not be added to xmlIdMap");
43
		}
44
	}
45

    
46
	public String getDbId(CdmBase cdmBase){
47
		if (cdmBase != null){
48
			return xmlIdMap.get(cdmBase.getUuid());
49
		}else{
50
			logger.warn("CdmBase was (null). No entries in xmlIdMap available");
51
			return null;
52
		}
53
	}
54

    
55
}
(61-61/65)