Merge branch 'release/4.7.0'
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / identifier / IdentifierImportConfigurator.java
1 /**
2 * Copyright (C) 2017 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 package eu.etaxonomy.cdm.io.identifier;
10
11 import java.io.InputStreamReader;
12 import java.util.UUID;
13
14 import eu.etaxonomy.cdm.database.ICdmDataSource;
15 import eu.etaxonomy.cdm.io.common.SimpleImportConfiguratorBase;
16 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
17 import eu.etaxonomy.cdm.model.reference.Reference;
18
19 /**
20 * Configurator for importing Identifier via csv for a given class.
21 *
22 * @author a.mueller
23 * @date 14.03.2017
24 */
25 public class IdentifierImportConfigurator
26 extends SimpleImportConfiguratorBase<InputStreamReader>{
27
28 private static final long serialVersionUID = 2399625330102810465L;
29
30 private Class<? extends IdentifiableEntity> cdmClass;
31 private UUID uuidIdentifierType;
32
33
34 /**
35 * @param source
36 * @param cdmDestination
37 * @return
38 */
39 public static IdentifierImportConfigurator NewInstance(InputStreamReader file,
40 ICdmDataSource cdmDestination) {
41 return new IdentifierImportConfigurator(file, cdmDestination);
42 }
43
44 // ****************** CONSTRUCTOR *****************************/
45
46 private IdentifierImportConfigurator(InputStreamReader file,
47 ICdmDataSource cdmDestination){
48 super(file, cdmDestination, null);
49 }
50
51 // *************************************
52
53
54 @Override
55 @SuppressWarnings("unchecked")
56 protected void makeIoClassList(){
57 ioClassList = new Class[]{
58 IdentifierImport.class,
59 };
60 }
61
62 public Class<? extends IdentifiableEntity> getCdmClass() {
63 return this.cdmClass;
64 }
65 public void setCdmClass(Class<? extends IdentifiableEntity> cdmClass) {
66 this.cdmClass = cdmClass;
67 }
68
69
70 public UUID getIdentifierTypeUuid() {
71 return uuidIdentifierType;
72 }
73
74 public void setIdentifierTypeUuid(UUID uuidIdentifierType) {
75 this.uuidIdentifierType = uuidIdentifierType;
76 }
77
78
79 /**
80 * {@inheritDoc}
81 */
82 @Override
83 public Reference getSourceReference() {
84 // TODO Auto-generated method stub
85 return null;
86 }
87
88 }