add generic config to ExcelImportState
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / excel / taxa / TaxonExcelImportState.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.excel.taxa;
12
13 import java.util.HashMap;
14 import java.util.HashSet;
15 import java.util.Map;
16 import java.util.Set;
17 import java.util.UUID;
18
19 import org.apache.log4j.Logger;
20
21 import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
22 import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
23 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
24 import eu.etaxonomy.cdm.model.taxon.Taxon;
25 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
26
27 /**
28 * @author a.mueller
29 * @created 11.05.2009
30 * @version 1.0
31 */
32 public class TaxonExcelImportState extends ExcelImportState<ExcelImportConfiguratorBase>{
33 @SuppressWarnings("unused")
34 private static final Logger logger = Logger.getLogger(TaxonExcelImportState.class);
35
36 /** Already processed authors */
37 private Set<String> authors = new HashSet<String>();
38 /** Taxon "light" containing all string info from columns */
39 private NormalExplicitRow normalExplicitRow = null;
40
41 private Map<Integer, TaxonBase> taxonMap= new HashMap<Integer, TaxonBase>();
42 private Map<String, TeamOrPersonBase> authorMap= new HashMap<String, TeamOrPersonBase>();
43
44
45 public TaxonExcelImportState(ExcelImportConfiguratorBase config) {
46 super(config);
47 }
48
49 /**
50 * @return the normalExplicitRow
51 */
52 public NormalExplicitRow getTaxonLight() {
53 return normalExplicitRow;
54 }
55
56 /**
57 * @param normalExplicitRow the normalExplicitRow to set
58 */
59 public void setTaxonLight(NormalExplicitRow normalExplicitRow) {
60 this.normalExplicitRow = normalExplicitRow;
61 }
62
63 /**
64 * @return the author
65 */
66 public Set<String> getAuthors() {
67 return authors;
68 }
69
70 /**
71 * @param author the author to set
72 */
73 public void setAuthors(Set<String> authors) {
74 this.authors = authors;
75 }
76
77
78 /**
79 * @param parentId
80 * @return
81 */
82 public TaxonBase getTaxonBase(Integer taxonId) {
83 return taxonMap.get(taxonId);
84 }
85
86
87 /**
88 * @param parentId
89 * @param taxon
90 */
91 public void putTaxon(Integer taxonId, TaxonBase taxonBase) {
92 taxonMap.put(taxonId, taxonBase);
93 }
94
95
96
97 }