2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.name
;
12 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
13 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
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
;
22 * The class representing a hybrid relationship between one of the {@link BotanicalName parents}
23 * of a hybrid taxon name and the hybrid taxon name itself. A hybrid taxon name
24 * is a {@link BotanicalName botanical taxon name} assigned to a hybrid plant following
25 * the {@link NomenclaturalCode#ICBN() ICBN} (Appendix I). A hybrid taxon name must have one
26 * of the hybrid flags set. The hybrid relationship includes a {@link HybridRelationshipType hybrid relationship type}
27 * (for instance "first parent" or "female parent") and the article of the ICBN
28 * on which the hybrid taxon name relies.
32 * @created 08-Nov-2007 13:06:26
34 @XmlAccessorType(XmlAccessType
.FIELD
)
35 @XmlType(name
= "HybridRelationship", propOrder
= {
39 public class HybridRelationship
extends RelationshipBase
<BotanicalName
, BotanicalName
, HybridRelationshipType
> {
41 private static final Logger logger
= Logger
.getLogger(HybridRelationship
.class);
43 //The nomenclatural code rule considered. The article/note/recommendation in the code in question that is commented on in
45 @XmlElement(name
= "RuleConsidered")
46 private String ruleConsidered
;
48 //for hibernate, don't use
50 private HybridRelationship(){
55 // ************* CONSTRUCTORS *************/
57 * Class constructor: creates a new hybrid relationship instance with no
58 * reference and adds it to the respective
59 * {@link BotanicalName#getHybridRelationships() botanical taxon name relation sets} of both involved names.
61 * @param toName the taxon name to be set as target for the new hybrid relationship
62 * @param fromName the taxon name to be set as source for the new hybrid relationship
63 * @param type the relationship type to be assigned to the new hybrid relationship
64 * @param ruleConsidered the string indicating the article of the ICBN for the hybrid taxon name
65 * @see #HybridRelationship(BotanicalName, BotanicalName, HybridRelationshipType, ReferenceBase, String, String)
66 * @see BotanicalName#addHybridRelationship(HybridRelationship)
68 protected HybridRelationship(BotanicalName hybridName
, BotanicalName parentName
, HybridRelationshipType type
, String ruleConsidered
) {
69 this(parentName
, hybridName
, type
, null, null, ruleConsidered
);
73 * Class constructor: creates a new hybrid relationship instance including
74 * its {@link reference.ReferenceBase reference source} and adds it to the respective
75 *{@link BotanicalName#getHybridRelationships() botanical taxon name relation sets} of both involved names.
77 * @param toName the taxon name to be set as target for the new hybrid relationship
78 * @param fromName the taxon name to be set as source for the new hybrid relationship
79 * @param type the relationship type to be assigned to the new hybrid relationship
80 * @param citation the reference source for the new hybrid relationship
81 * @param citationMicroReference the string with the details describing the exact localisation within the reference
82 * @param ruleConsidered the string indicating the article of the ICBN for the hybrid taxon name
83 * @see #HybridRelationship(BotanicalName, BotanicalName, HybridRelationshipType, String)
84 * @see BotanicalName#addHybridRelationship(HybridRelationship)
86 protected HybridRelationship(BotanicalName hybridName
, BotanicalName parentName
, HybridRelationshipType type
, ReferenceBase citation
, String citationMicroReference
, String ruleConsidered
) {
87 super(parentName
, hybridName
, type
, citation
, citationMicroReference
);
88 this.setRuleConsidered(ruleConsidered
);
91 //********* METHODS **************************************/
94 * Returns the {@link BotanicalName botanical taxon name} that plays the parent role
95 * in this hybrid relationship.
97 * @see #getHybridName()
98 * @see common.RelationshipBase#getRelatedFrom()
101 public BotanicalName
getParentName(){
102 return super.getRelatedFrom();
105 * @see #getParentName()
107 public void setParentName(BotanicalName parentName
){
108 super.setRelatedFrom(parentName
);
112 * Returns the {@link BotanicalName botanical taxon name} that plays the child role
113 * (the child is actually the hybrid taxon name) in this hybrid relationship.
115 * @see #getParentName()
116 * @see common.RelationshipBase#getRelatedTo()
119 public BotanicalName
getHybridName(){
120 return super.getRelatedTo();
123 * @see #getHybridName()
125 public void setHybridName(BotanicalName hybridName
){
126 super.setRelatedTo(hybridName
);
130 * Returns the ICBN rule considered (that is the
131 * article/note/recommendation in the nomenclatural code) for building
132 * the string representing the hybrid taxon name within this hybrid
135 public String
getRuleConsidered(){
136 return this.ruleConsidered
;
139 * @see #getRuleConsidered()
141 public void setRuleConsidered(String ruleConsidered
){
142 this.ruleConsidered
= ruleConsidered
;