2 * Copyright (C) 2020 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.
9 package eu
.etaxonomy
.cdm
.model
.taxon
;
12 import java
.util
.UUID
;
14 import javax
.xml
.bind
.annotation
.XmlEnumValue
;
16 import org
.apache
.logging
.log4j
.LogManager
;
17 import org
.apache
.logging
.log4j
.Logger
;
19 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
20 import eu
.etaxonomy
.cdm
.model
.term
.EnumeratedTermVoc
;
21 import eu
.etaxonomy
.cdm
.model
.term
.IEnumTerm
;
24 * The status for the placement (taxon node) of taxon/name in classification.
26 * For more information on the status see #10096, #9005, #8281
31 public enum TaxonNodeStatus
implements IEnumTerm
<TaxonNodeStatus
>{
33 //TODO maybe we want a status "Included" too, instead of making TaxonNode.status an optional
34 // attribute (see comments in #10096 attachement)
37 // * The placement of the taxon is doubtful or preliminary.
39 // @XmlEnumValue("Included")
40 // INCLDUDED(UUID.fromString("7601cc89-8896-4b85-a83e-91700fe45a1d"), "Included (default)","Taxon included in parent taxon (default)", "INC", "", null),
44 * The placement of the taxon is doubtful or preliminary.
46 @XmlEnumValue("Doubtful")
47 DOUBTFUL(UUID
.fromString("022ebae2-a020-4a8d-8ee1-886d98d3a4db"), "Doubtful", "Taxon incl. in parent taxon with doubts", "DOU", "?", null),
51 * The taxon is not placed to the correct place (yet). Instead it is placed here.
53 @XmlEnumValue("Unplaced")
54 UNPLACED(UUID
.fromString("92809dee-8b3f-4fd5-a915-638d7c86b351"), "Unplaced", "Taxon unplaced", "UNP", "??", null),
58 * The taxon or name for any reason is excluded from the treatment this {@link TaxonNode} belongs too.
59 * See sub status for more specific reasons.
61 @XmlEnumValue("Excluded")
62 EXCLUDED(UUID
.fromString("23d259b6-2d7e-4df6-8745-0e24fbe63187"), "Excluded", "Name/taxon excluded (unspecific)", "EXC", Character
.toString((char)248), null),
66 * Taxon or name excluded, geographically out of scope. <BR>
67 * E.g. a taxon that does not occur in the region of the flora treatment.
69 @XmlEnumValue("Excluded_geo")
70 EXCLUDED_GEO(UUID
.fromString("a76c0fa8-e04d-421c-ac10-07a3c6770d45"), "Excluded geo.", "Taxon excl. (geographically out of scope)", "EXCG", Character
.toString((char)248)+"g", EXCLUDED
),
74 * Taxon or name excluded, taxonomically out of scope. <BR>
75 * E.g. name being a taxon name or synonym belonging to a taxon that is not part of the treatment.
77 @XmlEnumValue("Excluded_tax")
78 EXCLUDED_TAX(UUID
.fromString("689a5821-e59d-4ec2-ae33-2331bdb39f34"),"Excluded tax.", "Taxon/name excl. (taxonomically out of sc.)", "EXCT", Character
.toString((char)248)+"t", EXCLUDED
),
82 * Name excluded for nomenclatural reasons. <BR>
83 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.
85 @XmlEnumValue("Excluded_nom")
86 EXCLUDED_NOM(UUID
.fromString("b4484183-6f19-4901-af96-0ab6183cebfb"), "Excluded nom.","Name excl. (for nomenclatural reasons)", "EXCN", Character
.toString((char)248)+"n", EXCLUDED
),
90 * Name of verified uncertain application <BR>
91 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.<BR>
92 * Alternative symbol: ↑ or u+2BD1 (https://unicode-table.com/en/2BD1/)
94 @XmlEnumValue("Uncertain_app")
95 UNCERTAIN_APPLICATION(UUID
.fromString("c87ea64a-f3d3-41fe-a4c5-dd6a8697fc46"), "Uncertain application", "Name of verified uncertain application", "UNA", Character
.toString((char)248)+"a", EXCLUDED
),
99 * Name of verified uncertain application <BR>
100 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.<BR>
101 * Alternative symbol: ↑ or u+2BD1 (https://unicode-table.com/en/2BD1/)
103 @XmlEnumValue("Unresolved")
104 UNRESOLVED(UUID
.fromString("ce6f2430-9662-4b78-8fc2-48b5fa9fd37e"), "Unresolved", "Unresolved name – to be further revised", "UNR", "u", null),
108 // **************** END ENUM **********************/
110 @SuppressWarnings("unused")
111 private static final Logger logger
= LogManager
.getLogger(TaxonNodeStatus
.class);
113 private String symbol
;
115 private TaxonNodeStatus(UUID uuid
, String label
, String key
, String symbol
){
116 this(uuid
, label
, label
, key
, symbol
, null);
119 private TaxonNodeStatus(UUID uuid
, String label
, String longLabel
, String key
, String symbol
, TaxonNodeStatus parent
){
120 delegateVocTerm
= EnumeratedTermVoc
.addTerm(getClass(), this, uuid
, longLabel
, key
, parent
);
121 this.symbol
= symbol
;
125 // *************************** DELEGATE **************************************/
127 private static EnumeratedTermVoc
<TaxonNodeStatus
> delegateVoc
;
128 private IEnumTerm
<TaxonNodeStatus
> delegateVocTerm
;
131 delegateVoc
= EnumeratedTermVoc
.getVoc(TaxonNodeStatus
.class);
135 public String
getKey(){return delegateVocTerm
.getKey();}
138 public String
getLabel(){return delegateVocTerm
.getLabel();}
141 public String
getLabel(Language language
){return delegateVocTerm
.getLabel(language
);}
144 public UUID
getUuid() {return delegateVocTerm
.getUuid();}
147 public TaxonNodeStatus
getKindOf() {return delegateVocTerm
.getKindOf();}
150 public Set
<TaxonNodeStatus
> getGeneralizationOf() {return delegateVocTerm
.getGeneralizationOf();}
153 public boolean isKindOf(TaxonNodeStatus ancestor
) {return delegateVocTerm
.isKindOf(ancestor
); }
156 public Set
<TaxonNodeStatus
> getGeneralizationOf(boolean recursive
) {return delegateVocTerm
.getGeneralizationOf(recursive
);}
158 public static TaxonNodeStatus
getByKey(String key
){return delegateVoc
.getByKey(key
);}
159 public static TaxonNodeStatus
getByUuid(UUID uuid
) {return delegateVoc
.getByUuid(uuid
);}
161 //**************** symbol **********************/
163 public String
getSymbol(){