smaller changes in ForSubtreeConfigurator
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / config / TaxonBaseDeletionConfigurator.java
1 /**
2 * Copyright (C) 2009 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.api.service.config;
10
11 import eu.etaxonomy.cdm.api.service.ITaxonService;
12
13 /**
14 * This class is used to configure taxonbase deletion.
15 *
16 * @see ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon) and ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym)
17 *
18 * @author k.luther
19 * @date 09.11.2011
20 *
21 */
22 public class TaxonBaseDeletionConfigurator extends DeleteConfiguratorBase{
23
24 private boolean deleteNameIfPossible = true;
25 private boolean deleteSynonymRelations = true;
26
27 private NameDeletionConfigurator nameDeletionConfig = new NameDeletionConfigurator();
28
29 /**
30 * If true the taxons name will be deleted if this is possible.
31 * It is possible if the name is not linked in a way that it can not be deleted.
32 * This depends also on the {@link NameDeletionConfigurator}
33 * @see #getNameDeletionConfig()
34 * @return
35 */
36 public boolean isDeleteNameIfPossible() {
37 return deleteNameIfPossible;
38 }
39
40 public void setDeleteNameIfPossible(boolean deleteNameIfPossible) {
41 this.deleteNameIfPossible = deleteNameIfPossible;
42 }
43
44 /**
45 * The configurator for name deletion. Only evaluated if {@link #isDeleteNameIfPossible()}
46 * is <code>true</code>.
47 * @see NameDeletionConfigurator
48 * @see #isDeleteNameIfPossible()
49 * @see #isDeleteSynonymsIfPossible()
50 * @return
51 */
52 public NameDeletionConfigurator getNameDeletionConfig() {
53 return nameDeletionConfig;
54 }
55
56 public void setNameDeletionConfig(NameDeletionConfigurator nameDeletionConfig) {
57 this.nameDeletionConfig = nameDeletionConfig;
58 }
59
60 /**
61 *
62 * If <code>true</code> all Synonym relations from taxon to synonyms will be
63 * removed.
64 * Synonyms itself will be removed depending on {@link #deleteSynonymsIfPossible}.
65 * @return
66 */
67 public boolean isDeleteSynonymRelations() {
68 return deleteSynonymRelations;
69 }
70
71 /**
72 * @param deleteSynonymRelations the deleteSynonymRelations to set
73 */
74 public void setDeleteSynonymRelations(boolean deleteSynonymRelations) {
75 this.deleteSynonymRelations = deleteSynonymRelations;
76 }
77 }