Project

General

Profile

Download (2.46 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2009 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
package eu.etaxonomy.cdm.api.service.config;
11

    
12
import eu.etaxonomy.cdm.api.service.ITaxonService;
13
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
14

    
15
/**
16
 * This class is used to configure taxonbase deletion.
17
 *
18
 * @see ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon) and ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym)
19
 *
20
 * @author k.luther
21
 * @date 09.11.2011
22
 *
23
 */
24
public class TaxonBaseDeletionConfigurator extends DeleteConfiguratorBase{
25

    
26
	private boolean deleteNameIfPossible = true;
27
	private boolean deleteSynonymRelations = true;
28

    
29
	private NameDeletionConfigurator nameDeletionConfig = new NameDeletionConfigurator();
30

    
31
	/**
32
	 * If true the taxons name will be deleted if this is possible.
33
	 * It is possible if the name is not linked in a way that it can not be deleted.
34
	 * This depends also on the {@link NameDeletionConfigurator}
35
	 * @see #getNameDeletionConfig()
36
	 * @return
37
	 */
38
	public boolean isDeleteNameIfPossible() {
39
		return deleteNameIfPossible;
40
	}
41

    
42
	public void setDeleteNameIfPossible(boolean deleteNameIfPossible) {
43
		this.deleteNameIfPossible = deleteNameIfPossible;
44
	}
45

    
46
	/**
47
	 * The configurator for name deletion. Only evaluated if {@link #isDeleteNameIfPossible()}
48
	 * is <code>true</code>.
49
	 * @see NameDeletionConfigurator
50
	 * @see #isDeleteNameIfPossible()
51
	 * @see #isDeleteSynonymsIfPossible()
52
	 * @return
53
	 */
54
	public NameDeletionConfigurator getNameDeletionConfig() {
55
		return nameDeletionConfig;
56
	}
57

    
58
	public void setNameDeletionConfig(NameDeletionConfigurator nameDeletionConfig) {
59
		this.nameDeletionConfig = nameDeletionConfig;
60
	}
61

    
62
	/**
63
    *
64
    * If <code>true</code> all {@link SynonymRelationship relations from taxon to synonyms} will be
65
    * removed.
66
    * Synonyms itself will be removed depending on {@link #deleteSynonymsIfPossible}.
67
    * @return
68
    */
69
    public boolean isDeleteSynonymRelations() {
70
        return deleteSynonymRelations;
71
    }
72

    
73
    /**
74
     * @param deleteSynonymRelations the deleteSynonymRelations to set
75
     */
76
    public void setDeleteSynonymRelations(boolean deleteSynonymRelations) {
77
        this.deleteSynonymRelations = deleteSynonymRelations;
78
    }
79
}
(18-18/21)