Project

General

Profile

Download (3.42 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2016 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.operation.config;
10

    
11
import eu.etaxonomy.cdm.database.ICdmDataSource;
12
import eu.etaxonomy.cdm.io.common.DefaultImportState;
13
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
14
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
15
import eu.etaxonomy.cdm.io.common.ImportStateBase;
16
import eu.etaxonomy.cdm.io.operation.SortIndexUpdaterWrapper;
17
import eu.etaxonomy.cdm.model.reference.Reference;
18

    
19
/**
20
 * @author k.luther
21
 * @date 08.07.2016
22
 *
23
 */
24
public class SortIndexUpdaterConfigurator  extends ImportConfiguratorBase<DefaultImportState<SetSecundumForSubtreeConfigurator>, Object> implements IImportConfigurator{
25

    
26

    
27
    private boolean doTaxonNode = true;
28
    private boolean doFeatureNode = true;
29
    private boolean doPolytomousKeyNode = true;
30

    
31
    private String subTreeIndex = null;
32

    
33
    private SortIndexUpdaterConfigurator(ICdmDataSource destination){
34
        super(null);
35
        this.setDestination(destination);
36
    }
37

    
38
    /**
39
     * @param destination
40
     * @return
41
     */
42
    public static SortIndexUpdaterConfigurator NewInstance(ICdmDataSource destination) {
43
        SortIndexUpdaterConfigurator result = new SortIndexUpdaterConfigurator(destination);
44
        return result;
45
    }
46

    
47
    /**
48
     * @param destination
49
     * @return
50
     */
51
    public static SortIndexUpdaterConfigurator NewInstance(ICdmDataSource destination, boolean doTaxonNode, boolean doFeatureNode, boolean doPolytomousKeyNode) {
52
        SortIndexUpdaterConfigurator result = new SortIndexUpdaterConfigurator(destination);
53
        result.doFeatureNode = doFeatureNode;
54
        result.doTaxonNode = doTaxonNode;
55
        result.doPolytomousKeyNode = doPolytomousKeyNode;
56
        return result;
57
    }
58

    
59

    
60
 // **************** GETTER / SETTER ************************************
61

    
62

    
63
    /**
64
     * @return the doTaxonNode
65
     */
66
    public boolean isDoTaxonNode() {
67
        return doTaxonNode;
68
    }
69
    /**
70
     * @param doTaxonNode the doTaxonNode to set
71
     */
72
    public void setDoTaxonNode(boolean doTaxonNode) {
73
        this.doTaxonNode = doTaxonNode;
74
    }
75
    /**
76
     * @return the doPolytomousKeyNode
77
     */
78
    public boolean isDoPolytomousKeyNode() {
79
        return doPolytomousKeyNode;
80
    }
81
    /**
82
     * @param doPolytomousKeyNode the doPolytomousKeyNode to set
83
     */
84
    public void setDoPolytomousKeyNode(boolean doPolytomousKeyNode) {
85
        this.doPolytomousKeyNode = doPolytomousKeyNode;
86
    }
87
    /**
88
     * @return the doFeatureNode
89
     */
90
    public boolean isDoFeatureNode() {
91
        return doFeatureNode;
92
    }
93
    /**
94
     * @param doFeatureNode the doFeatureNode to set
95
     */
96
    public void setDoFeatureNode(boolean doFeatureNode) {
97
        this.doFeatureNode = doFeatureNode;
98
    }
99

    
100
    @Override
101
    public <STATE extends ImportStateBase> STATE getNewState() {
102
        return (STATE) new DefaultImportState(this);
103
    }
104

    
105

    
106
    @Override
107
    protected void makeIoClassList() {
108
        ioClassList = new Class[]{
109
                     SortIndexUpdaterWrapper.class
110
        };
111
    }
112

    
113

    
114
    @Override
115
    public Reference getSourceReference() {
116
        return null;
117
    }
118

    
119

    
120
    @Override
121
    public boolean isValid() {
122
        //as no source needs to exist
123
        return true;
124
    }
125

    
126

    
127
}
(4-4/4)