Performed project cleanup.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / name / NomenclaturalStatus.java
1 /**
2 * Copyright (C) 2007 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
10 package eu.etaxonomy.cdm.model.name;
11
12
13 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
14 import org.apache.log4j.Logger;
15 import javax.persistence.*;
16 import javax.xml.bind.annotation.XmlAccessType;
17 import javax.xml.bind.annotation.XmlAccessorType;
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlType;
20
21 /**
22 * The class representing the assignation of a nomenclatural status to a
23 * {@link TaxonNameBase taxon name}. This includes a {@link NomenclaturalStatusType nomenclatural status type}
24 * (for instance "invalid", "novum" or "conserved") and eventually the article
25 * of the corresponding {@link NomenclaturalCode nomenclatural code} this status assignation is based on.
26 * One nomenclatural status type can be assigned to several taxon names.
27 *
28 * @author m.doering
29 * @version 1.0
30 * @created 08-Nov-2007 13:06:39
31 */
32 @XmlAccessorType(XmlAccessType.FIELD)
33 @XmlType(name = "", propOrder = {
34 "ruleConsidered",
35 "type"
36 })
37 @Entity
38 public class NomenclaturalStatus extends ReferencedEntityBase {
39
40 static Logger logger = Logger.getLogger(NomenclaturalStatus.class);
41
42 //The nomenclatural code rule considered. The article/note/recommendation in the code in question that is commented on in
43 //the note property.
44 @XmlElement(name = "ruleConsidered")
45 private String ruleConsidered;
46
47 @XmlElement(name = "NomenclaturalStatusType")
48 private NomenclaturalStatusType type;
49
50 /**
51 * Class constructor: creates a new empty nomenclatural status instance.
52 */
53 protected NomenclaturalStatus() {
54 super();
55 }
56
57 /**
58 * Creates a new nomenclatural status instance with a given
59 * {@link NomenclaturalStatusType nomenclatural status type}.
60 *
61 * @see #NomenclaturalStatus()
62 */
63 public static NomenclaturalStatus NewInstance(NomenclaturalStatusType nomStatusType){
64 NomenclaturalStatus status = new NomenclaturalStatus();
65 status.setType(nomStatusType);
66 return status;
67 }
68
69
70 /**
71 * Returns the {@link NomenclaturalStatusType nomenclatural status type} of <i>this</i>
72 * nomenclatural status.
73 */
74 @ManyToOne
75 public NomenclaturalStatusType getType(){
76 return this.type;
77 }
78
79 /**
80 * @see #getType()
81 */
82 public void setType(NomenclaturalStatusType type){
83 this.type = type;
84 }
85
86 /**
87 * Returns the nomenclatural code rule considered (that is the
88 * article/note/recommendation in the nomenclatural code ruling
89 * the {@link TaxonNameBase#getNomenclaturalCode() taxon name(s)}) of <i>this</i>
90 * nomenclatural status. The considered rule gives the reason why the
91 * {@link NomenclaturalStatusType nomenclatural status type} has been
92 * assigned to the {@link TaxonNameBase taxon name(s)}.
93 */
94 public String getRuleConsidered(){
95 return this.ruleConsidered;
96 }
97
98 /**
99 * @see #getRuleConsidered()
100 */
101 public void setRuleConsidered(String ruleConsidered){
102 this.ruleConsidered = ruleConsidered;
103 }
104
105 }