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
;
13 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipTermBase
;
14 import eu
.etaxonomy
.cdm
.model
.location
.Continent
;
16 import org
.apache
.log4j
.Logger
;
19 import javax
.persistence
.*;
20 import javax
.xml
.bind
.annotation
.XmlAccessType
;
21 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
22 import javax
.xml
.bind
.annotation
.XmlType
;
25 * http://rs.tdwg.org/ontology/voc/TaxonName.rdf#NomenclaturalNoteTypeTerm
26 * The relationship are to be understood as 'is .... of'. For instance
27 * Linum radiola L. is a replaced synonym of Radiola linoides Roth
28 * or Astragalus rhizanthus Boiss. is a later homonym of
29 * Astragalus rhizanthus Royle.
33 * @created 08-Nov-2007 13:06:38
35 @XmlAccessorType(XmlAccessType
.FIELD
)
38 public class NameRelationshipType
extends RelationshipTermBase
<NameRelationshipType
> {
39 static Logger logger
= Logger
.getLogger(NameRelationshipType
.class);
41 private static final UUID uuidOrthographicVariant
= UUID
.fromString("eeaea868-c4c1-497f-b9fe-52c9fc4aca53");
42 private static final UUID uuidLaterHomonym
= UUID
.fromString("80f06f65-58e0-4209-b811-cb40ad7220a6");
43 private static final UUID uuidTreatedAsLaterHomonym
= UUID
.fromString("2990a884-3302-4c8b-90b2-dfd31aaa2778");
44 private static final UUID uuidAlternativeName
= UUID
.fromString("049c6358-1094-4765-9fae-c9972a0e7780");
45 private static final UUID uuidBasionym
= UUID
.fromString("25792738-98de-4762-bac1-8c156faded4a");
46 private static final UUID uuidReplacedSynonym
= UUID
.fromString("71c67c38-d162-445b-b0c2-7aba56106696");
47 private static final UUID uuidConservedAgainst
= UUID
.fromString("e6439f95-bcac-4ebb-a8b5-69fa5ce79e6a");
48 private static final UUID uuidValidatedByName
= UUID
.fromString("a176c9ad-b4c2-4c57-addd-90373f8270eb");
49 private static final UUID uuidLaterValidatedByName
= UUID
.fromString("a25ee4c1-863a-4dab-9499-290bf9b89639");
50 private static final UUID uuidBlockingNameFor
= UUID
.fromString("1dab357f-2e12-4511-97a4-e5153589e6a6");
52 public NameRelationshipType() {
56 public NameRelationshipType(String term
, String label
, String labelAbbrev
, boolean symmetric
, boolean transitive
) {
57 super(term
, label
, labelAbbrev
, symmetric
, transitive
);
61 public static final NameRelationshipType
getByUuid(UUID uuid
){
62 return (NameRelationshipType
)findByUuid(uuid
);
66 public boolean isInvalidType(){
67 if (this.equals(VALIDATED_BY_NAME()) ||
68 this.equals(LATER_VALIDATED_BY_NAME())
77 public boolean isLegitimateType(){
78 if (this.equals(BASIONYM()) ||
79 this.equals(REPLACED_SYNONYM()) ||
80 this.equals(ALTERNATIVE_NAME()) ||
81 this.equals(CONSERVED_AGAINST())
90 public boolean isIllegitimateType(){
91 //TODO: implement isX method. Maybe as persistent class attribute?
92 //TODO: RejectedInFavour,
93 if (this.equals(LATER_HOMONYM()) ||
94 this.equals(TREATED_AS_LATER_HOMONYM())
103 public static final NameRelationshipType
ORTHOGRAPHIC_VARIANT(){
104 return getByUuid(uuidOrthographicVariant
);
106 public static final NameRelationshipType
LATER_HOMONYM(){
107 return getByUuid(uuidLaterHomonym
);
109 public static final NameRelationshipType
TREATED_AS_LATER_HOMONYM(){
110 return getByUuid(uuidTreatedAsLaterHomonym
);
112 public static final NameRelationshipType
ALTERNATIVE_NAME(){
113 return getByUuid(uuidAlternativeName
);
115 public static final NameRelationshipType
BASIONYM(){
116 return getByUuid(uuidBasionym
);
118 public static final NameRelationshipType
REPLACED_SYNONYM(){
119 return getByUuid(uuidReplacedSynonym
);
121 public static final NameRelationshipType
CONSERVED_AGAINST(){
122 return getByUuid(uuidConservedAgainst
);
124 public static final NameRelationshipType
VALIDATED_BY_NAME(){
125 return getByUuid(uuidValidatedByName
);
127 public static final NameRelationshipType
LATER_VALIDATED_BY_NAME(){
128 return getByUuid(uuidLaterValidatedByName
);
130 public static final NameRelationshipType
BLOCKING_NAME_FOR(){
131 return getByUuid(uuidBlockingNameFor
);