Split table DefinedTermBase_TermVocabulary into DefinedTermBase_RecommendedModifierEn...
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / Feature.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.description;
11
12
13 import java.util.HashSet;
14 import java.util.List;
15 import java.util.Set;
16 import java.util.UUID;
17
18 import javax.persistence.Entity;
19 import javax.persistence.JoinTable;
20 import javax.persistence.ManyToMany;
21 import javax.persistence.OneToMany;
22 import javax.persistence.Transient;
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlElementWrapper;
27 import javax.xml.bind.annotation.XmlIDREF;
28 import javax.xml.bind.annotation.XmlRootElement;
29 import javax.xml.bind.annotation.XmlSchemaType;
30 import javax.xml.bind.annotation.XmlType;
31
32 import org.apache.log4j.Logger;
33 import org.hibernate.annotations.Cascade;
34 import org.hibernate.annotations.CascadeType;
35
36 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
37 import eu.etaxonomy.cdm.model.common.ILoadableTerm;
38 import eu.etaxonomy.cdm.model.common.Language;
39 import eu.etaxonomy.cdm.model.common.TermVocabulary;
40 import eu.etaxonomy.cdm.model.name.BotanicalName;
41 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
42 import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
43 import eu.etaxonomy.cdm.model.name.NameRelationship;
44 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
45 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
46 import eu.etaxonomy.cdm.model.name.NonViralName;
47 import eu.etaxonomy.cdm.model.name.Rank;
48 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
49 import eu.etaxonomy.cdm.model.occurrence.Specimen;
50 import eu.etaxonomy.cdm.model.taxon.Taxon;
51
52 /**
53 * The class for individual properties (also designed as character, type or
54 * category) of observed phenomena able to be described or measured. It also
55 * covers categories of informations on {@link TaxonNameBase taxon names} not
56 * taken in account in {@link NomenclaturalCode nomenclature}.<BR>
57 * Descriptions require features in order to be structured and disaggregated
58 * in {@link DescriptionElementBase description elements}.<BR>
59 * Experts do not use the word feature for the actual description
60 * but only for the property itself. Therefore naming this class FeatureType
61 * would have leaded to confusion.
62 * <P>
63 * Since features are {@link DefinedTermBase defined terms} they have a hierarchical
64 * structure that allows to specify ("kind of") or generalize
65 * ("generalization of") features. "Kind of" / "generalization of" relations
66 * are bidirectional (a feature F1 is a "Kind of" a feature F2 if and only
67 * if the feature F2 is a "generalization of" the feature F1. This hierarchical
68 * structure has nothing in common with {@link FeatureTree feature trees} used for determination.
69 * <P>
70 * A standard set of feature instances will be automatically
71 * created as the project starts. But this class allows to extend this standard
72 * set by creating new instances of additional features if needed.<BR>
73 * <P>
74 * This class corresponds to DescriptionsSectionType according to the SDD
75 * schema.
76 *
77 * @author m.doering
78 * @version 1.0
79 * @created 08-Nov-2007 13:06:24
80 */
81 @XmlAccessorType(XmlAccessType.FIELD)
82 @XmlType(name="Feature", factoryMethod="NewInstance", propOrder = {
83 "supportsTextData",
84 "supportsQuantitativeData",
85 "supportsDistribution",
86 "supportsIndividualAssociation",
87 "supportsTaxonInteraction",
88 "supportsCommonTaxonName",
89 "recommendedModifierEnumeration",
90 "recommendedStatisticalMeasures",
91 "supportedCategoricalEnumerations"
92 })
93 @XmlRootElement(name = "Feature")
94 @Entity
95 public class Feature extends DefinedTermBase {
96 static Logger logger = Logger.getLogger(Feature.class);
97
98 @XmlElement(name = "SupportsTextData")
99 private boolean supportsTextData;
100
101 @XmlElement(name = "SupportsQuantitativeData")
102 private boolean supportsQuantitativeData;
103
104 @XmlElement(name = "SupportsDistribution")
105 private boolean supportsDistribution;
106
107 @XmlElement(name = "SupportsIndividualAssociation")
108 private boolean supportsIndividualAssociation;
109
110 @XmlElement(name = "SupportsTaxonInteraction")
111 private boolean supportsTaxonInteraction;
112
113 @XmlElement(name = "SupportsCommonTaxonName")
114 private boolean supportsCommonTaxonName;
115
116 @XmlElementWrapper(name = "RecommendedModifierEnumerations")
117 @XmlElement(name = "RecommendedModifierEnumeration")
118 @XmlIDREF
119 @XmlSchemaType(name = "IDREF")
120 private Set<TermVocabulary> recommendedModifierEnumeration = new HashSet<TermVocabulary>();
121
122 @XmlElementWrapper(name = "RecommendedStatisticalMeasures")
123 @XmlElement(name = "RecommendedStatisticalMeasure")
124 @XmlIDREF
125 @XmlSchemaType(name = "IDREF")
126 private Set<StatisticalMeasure> recommendedStatisticalMeasures = new HashSet<StatisticalMeasure>();
127
128 @XmlElementWrapper(name = "SupportedCategoricalEnumerations")
129 @XmlElement(name = "SupportedCategoricalEnumeration")
130 @XmlIDREF
131 @XmlSchemaType(name = "IDREF")
132 private Set<TermVocabulary> supportedCategoricalEnumerations = new HashSet<TermVocabulary>();
133
134 /* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
135
136
137 /**
138 * Class constructor: creates a new empty feature instance.
139 *
140 * @see #Feature(String, String, String)
141 */
142 public Feature() {
143 super();
144 }
145
146 /**
147 * Class constructor: creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
148 * a label and a label abbreviation.
149 *
150 * @param term the string (in the default language) describing the
151 * new feature to be created
152 * @param label the string identifying the new feature to be created
153 * @param labelAbbrev the string identifying (in abbreviated form) the
154 * new feature to be created
155 * @see #Feature()
156 */
157 protected Feature(String term, String label, String labelAbbrev) {
158 super(term, label, labelAbbrev);
159 }
160
161 /**
162 * Creates a new empty feature instance.
163 *
164 * @see #NewInstance(String, String, String)
165 */
166 public static Feature NewInstance() {
167 return new Feature();
168 }
169
170 /**
171 * Creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
172 * a label and a label abbreviation.
173 *
174 * @param term the string (in the default language) describing the
175 * new feature to be created
176 * @param label the string identifying the new feature to be created
177 * @param labelAbbrev the string identifying (in abbreviated form) the
178 * new feature to be created
179 * @see #readCsvLine(List, Language)
180 * @see #NewInstance()
181 */
182 public static Feature NewInstance(String term, String label, String labelAbbrev){
183 return new Feature(term, label, labelAbbrev);
184 }
185
186 /* *************************************************************************************/
187
188 /**
189 * Returns the boolean value of the flag indicating whether <i>this</i>
190 * feature can be described with {@link QuantitativeData quantitative data} (true)
191 * or not (false). If this flag is set <i>this</i> feature can only apply to
192 * {@link TaxonDescription taxon descriptions} or {@link SpecimenDescription specimen descriptions}.
193 *
194 * @return the boolean value of the supportsQuantitativeData flag
195 */
196 public boolean isSupportsQuantitativeData() {
197 return supportsQuantitativeData;
198 }
199
200 /**
201 * @see #isSupportsQuantitativeData()
202 */
203 public void setSupportsQuantitativeData(boolean supportsQuantitativeData) {
204 this.supportsQuantitativeData = supportsQuantitativeData;
205 }
206
207 /**
208 * Returns the boolean value of the flag indicating whether <i>this</i>
209 * feature can be described with {@link TextData text data} (true)
210 * or not (false).
211 *
212 * @return the boolean value of the supportsTextData flag
213 */
214 public boolean isSupportsTextData() {
215 return supportsTextData;
216 }
217
218 /**
219 * @see #isSupportsTextData()
220 */
221 public void setSupportsTextData(boolean supportsTextData) {
222 this.supportsTextData = supportsTextData;
223 }
224
225 /**
226 * Returns the boolean value of the flag indicating whether <i>this</i>
227 * feature can be described with {@link Distribution distribution} objects
228 * (true) or not (false). This flag is set if and only if <i>this</i> feature
229 * is the {@link #DISTRIBUTION() distribution feature}.
230 *
231 * @return the boolean value of the supportsDistribution flag
232 */
233 public boolean isSupportsDistribution() {
234 return supportsDistribution;
235 }
236
237 /**
238 * @see #isSupportsDistribution()
239 */
240 public void setSupportsDistribution(boolean supportsDistribution) {
241 this.supportsDistribution = supportsDistribution;
242 }
243
244 /**
245 * Returns the boolean value of the flag indicating whether <i>this</i>
246 * feature can be described with {@link IndividualsAssociation individuals associations}
247 * (true) or not (false).
248 *
249 * @return the boolean value of the supportsIndividualAssociation flag
250 */
251 public boolean isSupportsIndividualAssociation() {
252 return supportsIndividualAssociation;
253 }
254
255 /**
256 * @see #isSupportsIndividualAssociation()
257 */
258 public void setSupportsIndividualAssociation(
259 boolean supportsIndividualAssociation) {
260 this.supportsIndividualAssociation = supportsIndividualAssociation;
261 }
262
263 /**
264 * Returns the boolean value of the flag indicating whether <i>this</i>
265 * feature can be described with {@link TaxonInteraction taxon interactions}
266 * (true) or not (false).
267 *
268 * @return the boolean value of the supportsTaxonInteraction flag
269 */
270 public boolean isSupportsTaxonInteraction() {
271 return supportsTaxonInteraction;
272 }
273
274 /**
275 * @see #isSupportsTaxonInteraction()
276 */
277 public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction) {
278 this.supportsTaxonInteraction = supportsTaxonInteraction;
279 }
280
281 /**
282 * Returns the boolean value of the flag indicating whether <i>this</i>
283 * feature can be described with {@link CommonTaxonName common names}
284 * (true) or not (false). This flag is set if and only if <i>this</i> feature
285 * is the {@link #COMMON_NAME() common name feature}.
286 *
287 * @return the boolean value of the supportsCommonTaxonName flag
288 */
289 public boolean isSupportsCommonTaxonName() {
290 return supportsCommonTaxonName;
291 }
292
293 /**
294 * @see #isSupportsTaxonInteraction()
295 */
296 public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName) {
297 this.supportsCommonTaxonName = supportsCommonTaxonName;
298 }
299
300 /**
301 * Returns the set of {@link TermVocabulary term vocabularies} containing the
302 * {@link Modifier modifiers} recommended to be used for {@link DescriptionElementBase description elements}
303 * with <i>this</i> feature.
304 */
305 @OneToMany
306 @JoinTable(
307 name="DefinedTermBase_RecommendedModifierEnumeration"
308 )
309 public Set<TermVocabulary> getRecommendedModifierEnumeration() {
310 return recommendedModifierEnumeration;
311 }
312
313 /**
314 * @see #getRecommendedModifierEnumeration()
315 */
316 protected void setRecommendedModifierEnumeration(
317 Set<TermVocabulary> recommendedModifierEnumeration) {
318 this.recommendedModifierEnumeration = recommendedModifierEnumeration;
319 }
320
321 /**
322 * Adds a {@link TermVocabulary term vocabulary} (with {@link Modifier modifiers}) to the set of
323 * {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies} assigned
324 * to <i>this</i> feature.
325 *
326 * @param recommendedModifierEnumeration the term vocabulary to be added
327 * @see #getRecommendedModifierEnumeration()
328 */
329 public void addRecommendedModifierEnumeration(
330 TermVocabulary recommendedModifierEnumeration) {
331 this.recommendedModifierEnumeration.add(recommendedModifierEnumeration);
332 }
333 /**
334 * Removes one element from the set of {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies}
335 * assigned to <i>this</i> feature.
336 *
337 * @param recommendedModifierEnumeration the term vocabulary which should be removed
338 * @see #getRecommendedModifierEnumeration()
339 * @see #addRecommendedModifierEnumeration(TermVocabulary)
340 */
341 public void removeRecommendedModifierEnumeration(
342 TermVocabulary recommendedModifierEnumeration) {
343 this.recommendedModifierEnumeration.remove(recommendedModifierEnumeration);
344 }
345
346 /**
347 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
348 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
349 */
350 @ManyToMany
351 @JoinTable(
352 name="DefinedTermBase_StatisticalMeasure"
353 )
354 // @Cascade({CascadeType.SAVE_UPDATE})
355 public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
356 return recommendedStatisticalMeasures;
357 }
358
359 /**
360 * @see #getRecommendedStatisticalMeasures()
361 */
362 protected void setRecommendedStatisticalMeasures(
363 Set<StatisticalMeasure> recommendedStatisticalMeasures) {
364 this.recommendedStatisticalMeasures = recommendedStatisticalMeasures;
365 }
366
367 /**
368 * Adds a {@link StatisticalMeasure statistical measure} to the set of
369 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
370 * to <i>this</i> feature.
371 *
372 * @param recommendedStatisticalMeasure the statistical measure to be added
373 * @see #getRecommendedStatisticalMeasures()
374 */
375 public void addRecommendedStatisticalMeasure(
376 StatisticalMeasure recommendedStatisticalMeasure) {
377 this.recommendedStatisticalMeasures.add(recommendedStatisticalMeasure);
378 }
379 /**
380 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
381 * assigned to <i>this</i> feature.
382 *
383 * @param recommendedStatisticalMeasure the statistical measure which should be removed
384 * @see #getRecommendedStatisticalMeasures()
385 * @see #addRecommendedStatisticalMeasure(StatisticalMeasure)
386 */
387 public void removeRecommendedStatisticalMeasure(
388 StatisticalMeasure recommendedStatisticalMeasure) {
389 this.recommendedStatisticalMeasures.remove(recommendedStatisticalMeasure);
390 }
391
392 /**
393 * Returns the set of {@link TermVocabulary term vocabularies} containing the list of
394 * possible {@link State states} to be used in {@link CategoricalData categorical data}
395 * with <i>this</i> feature.
396 */
397 @OneToMany
398 @JoinTable(
399 name="DefinedTermBase_CategoricalEnumeration"
400 )
401 public Set<TermVocabulary> getSupportedCategoricalEnumerations() {
402 return supportedCategoricalEnumerations;
403 }
404
405 /**
406 * @see #getSupportedCategoricalEnumerations()
407 */
408 protected void setSupportedCategoricalEnumerations(
409 Set<TermVocabulary> supportedCategoricalEnumerations) {
410 this.supportedCategoricalEnumerations = supportedCategoricalEnumerations;
411 }
412 /**
413 * Adds a {@link TermVocabulary term vocabulary} to the set of
414 * {@link #getSupportedCategoricalEnumerations() supported state vocabularies} assigned
415 * to <i>this</i> feature.
416 *
417 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
418 * @see #getSupportedCategoricalEnumerations()
419 */
420 public void addSupportedCategoricalEnumeration(
421 TermVocabulary supportedCategoricalEnumeration) {
422 this.supportedCategoricalEnumerations.add(supportedCategoricalEnumeration);
423 }
424 /**
425 * Removes one element from the set of {@link #getSupportedCategoricalEnumerations() supported state vocabularies}
426 * assigned to <i>this</i> feature.
427 *
428 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
429 * @see #getSupportedCategoricalEnumerations()
430 * @see #addSupportedCategoricalEnumeration(TermVocabulary)
431 */
432 public void removeSupportedCategoricalEnumeration(
433 TermVocabulary supportedCategoricalEnumeration) {
434 this.supportedCategoricalEnumerations.remove(supportedCategoricalEnumeration);
435 }
436
437
438 private static final UUID uuidUnknown = UUID.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c");
439 private static final UUID uuidDescription = UUID.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493");
440 private static final UUID uuidDistribution = UUID.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6");
441 private static final UUID uuidEcology = UUID.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b");
442 private static final UUID uuidBiologyEcology = UUID.fromString("9832e24f-b670-43b4-ac7c-20a7261a1d8c");
443 private static final UUID uuidKey = UUID.fromString("a677f827-22b9-4205-bb37-11cb48dd9106");
444 private static final UUID uuidMaterialsExamined = UUID.fromString("7c0c7571-a864-47c1-891d-01f59000dae1");
445 private static final UUID uuidMaterialsMethods = UUID.fromString("1e87d9c3-0844-4a03-9686-773e2ccb3ab6");
446 private static final UUID uuidEtymology = UUID.fromString("dd653d48-355c-4aec-a4e7-724f6eb29f8d");
447 private static final UUID uuidDiagnosis = UUID.fromString("d43d8501-ceab-4caa-9e51-e87138528fac");
448 private static final UUID uuidProtolog = UUID.fromString("7f1fd111-fc52-49f0-9e75-d0097f576b2d");
449 private static final UUID uuidCommonName = UUID.fromString("fc810911-51f0-4a46-ab97-6562fe263ae5");
450 private static final UUID uuidPhenology = UUID.fromString("a7786d3e-7c58-4141-8416-346d4c80c4a2");
451 private static final UUID uuidOccurrence = UUID.fromString("5deff505-1a32-4817-9a74-50e6936fd630");
452 private static final UUID uuidCitation = UUID.fromString("99b2842f-9aa7-42fa-bd5f-7285311e0101");
453 private static final UUID uuidAdditionalPublication = UUID.fromString("cb2eab09-6d9d-4e43-8ad2-873f23400930");
454 private static final UUID uuidUses = UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6");
455 private static final UUID uuidConservation = UUID.fromString("4518fc20-2492-47de-b345-777d2b83c9cf");
456 private static final UUID uuidCultivation = UUID.fromString("e28965b2-a367-48c5-b954-8afc8ac2c69b");
457 private static final UUID uuidIntroduction = UUID.fromString("e75255ca-8ff4-4905-baad-f842927fe1d3");
458 private static final UUID uuidDiscussion = UUID.fromString("d3c4cbb6-0025-4322-886b-cd0156753a25");
459
460
461
462 // private static final UUID uuidDistribution = UUID.fromString("");
463 // private static final UUID uuidDistribution = UUID.fromString("");
464 // private static final UUID uuidDistribution = UUID.fromString("");
465
466 // "86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract"
467 // "489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis"
468 // "89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple"
469 // "555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments"
470
471
472 /**
473 * Creates and returns a new feature instance on the basis of a given string
474 * list (containing an UUID, an URI, a label and a description) and a given
475 * {@link Language language} to be associated with the description. Furthermore
476 * the flags concerning the supported subclasses of {@link DescriptionElementBase description elements}
477 * are set according to a particular string belonging to the given
478 * string list.<BR>
479 * This method overrides the readCsvLine method from {@link DefinedTermBase#readCsvLine(List, Language) DefinedTermBase}.
480 *
481 * @param csvLine the string list with elementary information for attributes
482 * @param lang the language in which the description has been formulated
483 * @see #NewInstance(String, String, String)
484 */
485 @Override
486 public ILoadableTerm readCsvLine(List csvLine, Language lang) {
487 // TODO Auto-generated method stub
488 super.readCsvLine(csvLine, lang);
489 String text = (String)csvLine.get(4);
490 if (text != null && text.length() >= 6){
491 if ("1".equals(text.substring(0, 1))){this.setSupportsTextData(true);};
492 if ("1".equals(text.substring(1, 2))){this.setSupportsQuantitativeData(true);};
493 if ("1".equals(text.substring(2, 3))){this.setSupportsDistribution(true);};
494 if ("1".equals(text.substring(3, 4))){this.setSupportsIndividualAssociation(true);};
495 if ("1".equals(text.substring(4, 5))){this.setSupportsTaxonInteraction(true);};
496 if ("1".equals(text.substring(5, 6))){this.setSupportsCommonTaxonName(true);};
497 }
498 return this;
499 }
500
501 /**
502 * Returns the feature identified through its immutable universally
503 * unique identifier (UUID).
504 *
505 * @param uuid the universally unique identifier
506 * @return the feature corresponding to the given
507 * universally unique identifier
508 */
509 public static final Feature getByUuid(UUID uuid){
510 return (Feature)findByUuid(uuid);
511 }
512
513 /**
514 * Returns the "unknown" feature. This feature allows to store values of
515 * {@link DescriptionElementBase description elements} even if it is momentarily
516 * not known what they mean.
517 */
518 public static final Feature UNKNOWN(){
519 return getByUuid(uuidUnknown);
520 }
521
522 /**
523 * Returns the "description" feature. This feature allows to handle global
524 * {@link DescriptionElementBase description elements} for a global {@link DescriptionBase description}.<BR>
525 * The "description" feature is the highest level feature.
526 */
527 public static final Feature DESCRIPTION(){
528 return getByUuid(uuidDescription);
529 }
530
531 /**
532 * Returns the "distribution" feature. This feature allows to handle only
533 * {@link Distribution distributions}.
534 *
535 * @see #isSupportsDistribution()
536 */
537 public static final Feature DISTRIBUTION(){
538 return getByUuid(uuidDistribution);
539 }
540
541 /**
542 * Returns the "discussion" feature. This feature can only be described
543 * with {@link TextData text data}.
544 *
545 * @see #isSupportsTextData()
546 */
547 public static final Feature DISCUSSION(){
548 return getByUuid(uuidDiscussion);
549 }
550
551 /**
552 * Returns the "ecology" feature. This feature only applies
553 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
554 * The "ecology" feature generalizes all other possible features concerning
555 * ecological matters.
556 */
557 public static final Feature ECOLOGY(){
558 return getByUuid(uuidEcology);
559 }
560
561 /**
562 * Returns the "biology_ecology" feature. This feature only applies
563 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
564 * The "biology_ecology" feature generalizes all possible features concerning
565 * biological aspects of ecological matters.
566 *
567 * @see #ECOLOGY()
568 */
569 public static final Feature BIOLOGY_ECOLOGY(){
570 return getByUuid(uuidBiologyEcology);
571 }
572
573 /**
574 * Returns the "key" feature. This feature is the "upper" feature generalizing
575 * all features being used within an identification key.
576 */
577 public static final Feature KEY(){
578 return getByUuid(uuidKey);
579 }
580
581
582 /**
583 * Returns the "materials_examined" feature. This feature can only be described
584 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
585 * mentioning which material has been examined in order to accomplish
586 * the description. This feature applies only to
587 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
588 */
589 public static final Feature MATERIALS_EXAMINED(){
590 return getByUuid(uuidMaterialsExamined);
591 }
592
593 /**
594 * Returns the "materials_methods" feature. This feature can only be described
595 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
596 * mentioning which methods have been adopted to analyze the material in
597 * order to accomplish the description. This feature applies only to
598 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
599 */
600 public static final Feature MATERIALS_METHODS(){
601 return getByUuid(uuidMaterialsMethods);
602 }
603
604 /**
605 * Returns the "etymology" feature. This feature can only be described
606 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
607 * giving some information about the history of the taxon name. This feature applies only to
608 * {@link TaxonNameDescription taxon name descriptions}.
609 */
610 public static final Feature ETYMOLOGY(){
611 return getByUuid(uuidEtymology);
612 }
613
614 /**
615 * Returns the "diagnosis" feature. This feature can only be described
616 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}.
617 * This feature applies only to {@link SpecimenDescription specimen descriptions} or to
618 * {@link TaxonDescription taxon descriptions}.
619 */
620 public static final Feature DIAGNOSIS(){
621 return getByUuid(uuidDiagnosis);
622 }
623
624
625 /**
626 * Returns the "introduction" feature. This feature can only be described
627 * with {@link TextData text data}.
628 *
629 * @see #isSupportsTextData()
630 */
631 public static final Feature INTRODUCTION(){
632 return getByUuid(uuidIntroduction);
633 }
634
635 /**
636 * Returns the "protologue" feature. This feature can only be described
637 * with {@link TextData text data} reproducing the content of the protologue
638 * (or some information about it) of the taxon name. This feature applies only to
639 * {@link TaxonNameDescription taxon name descriptions}.
640 *
641 * @see #isSupportsTextData()
642 */
643 public static final Feature PROTOLOG(){
644 return getByUuid(uuidProtolog);
645 }
646 /**
647 * Returns the "common_name" feature. This feature allows to handle only
648 * {@link CommonTaxonName common names}.
649 *
650 * @see #isSupportsCommonTaxonName()
651 */
652 public static final Feature COMMON_NAME(){
653 return getByUuid(uuidCommonName);
654 }
655
656 /**
657 * Returns the "phenology" feature. This feature can only be described
658 * with {@link CategoricalData categorical data} or eventually with {@link TextData text data}
659 * containing information time about recurring natural phenomena.
660 * This feature only applies to {@link TaxonDescription taxon descriptions}.<BR>
661 * The "phenology" feature generalizes all other possible features
662 * concerning time information about particular natural phenomena
663 * (such as "first flight of butterflies").
664 */
665 public static final Feature PHENOLOGY(){
666 return getByUuid(uuidPhenology);
667 }
668
669
670 /**
671 * Returns the "occurrence" feature.
672 */
673 public static final Feature OCCURRENCE(){
674 return getByUuid(uuidOccurrence);
675 }
676
677 /**
678 * Returns the "citation" feature. This feature can only be described
679 * with {@link TextData text data}.
680 *
681 * @see #isSupportsTextData()
682 */
683 public static final Feature CITATION(){
684 return getByUuid(uuidCitation);
685 }
686
687 /**
688 * Returns the "additional_publication" feature. This feature can only be
689 * described with {@link TextData text data} with information about a
690 * publication where a {@link TaxonNameBase taxon name} has also been published
691 * but which is not the {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference}.
692 * This feature applies only to {@link TaxonNameDescription taxon name descriptions}.
693 *
694 * @see #isSupportsTextData()
695 */
696 public static final Feature ADDITIONAL_PUBLICATION(){
697 return getByUuid(uuidAdditionalPublication);
698 }
699
700
701 /**
702 * Returns the "uses" feature. This feature only applies
703 * to {@link TaxonDescription taxon descriptions}.<BR>
704 * The "uses" feature generalizes all other possible features concerning
705 * particular uses (for instance "industrial use of seeds").
706 */
707 public static final Feature USES(){
708 return getByUuid(uuidUses);
709 }
710
711
712 /**
713 * Returns the "conservation" feature. This feature only applies
714 * to {@link SpecimenDescription specimen descriptions} and generalizes
715 * methods and conditions for the conservation of {@link Specimen specimens}.<BR>
716 */
717 public static final Feature CONSERVATION(){
718 return getByUuid(uuidConservation);
719 }
720
721
722 /**
723 * Returns the "cultivation" feature.
724 */
725 public static final Feature CULTIVATION(){
726 return getByUuid(uuidCultivation);
727 }
728
729
730 /**
731 * Returns the "hybrid_parent" feature. This feature can only be used
732 * by {@link TaxonInteraction taxon interactions}.<BR>
733 * <P>
734 * Note: It must be distinguished between hybrid relationships as
735 * relevant nomenclatural relationships between {@link BotanicalName plant names}
736 * on the one side and the biological relation between two {@link Taxon taxa}
737 * as it is here the case on the other one.
738 *
739 * @see #isSupportsTaxonInteraction()
740 * @see HybridRelationshipType
741 */
742 public static final Feature HYBRID_PARENT(){
743 //TODO
744 logger.warn("HYBRID_PARENT not yet implemented");
745 return null;
746 }
747
748
749 }