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
.description
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
17 import java
.util
.UUID
;
19 import javax
.persistence
.Entity
;
20 import javax
.persistence
.FetchType
;
21 import javax
.persistence
.JoinTable
;
22 import javax
.persistence
.ManyToMany
;
23 import javax
.persistence
.OneToMany
;
24 import javax
.xml
.bind
.annotation
.XmlAccessType
;
25 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
26 import javax
.xml
.bind
.annotation
.XmlElement
;
27 import javax
.xml
.bind
.annotation
.XmlElementWrapper
;
28 import javax
.xml
.bind
.annotation
.XmlIDREF
;
29 import javax
.xml
.bind
.annotation
.XmlRootElement
;
30 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
31 import javax
.xml
.bind
.annotation
.XmlType
;
33 import org
.apache
.log4j
.Logger
;
34 import org
.hibernate
.envers
.Audited
;
35 import org
.hibernate
.search
.annotations
.Indexed
;
37 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
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
.HybridRelationshipType
;
42 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
43 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
44 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
45 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
48 * The class for individual properties (also designed as character, type or
49 * category) of observed phenomena able to be described or measured. It also
50 * covers categories of informations on {@link TaxonNameBase taxon names} not
51 * taken in account in {@link NomenclaturalCode nomenclature}.<BR>
52 * Descriptions require features in order to be structured and disaggregated
53 * in {@link DescriptionElementBase description elements}.<BR>
54 * Experts do not use the word feature for the actual description
55 * but only for the property itself. Therefore naming this class FeatureType
56 * would have leaded to confusion.
58 * Since features are {@link DefinedTermBase defined terms} they have a hierarchical
59 * structure that allows to specify ("kind of") or generalize
60 * ("generalization of") features. "Kind of" / "generalization of" relations
61 * are bidirectional (a feature F1 is a "Kind of" a feature F2 if and only
62 * if the feature F2 is a "generalization of" the feature F1. This hierarchical
63 * structure has nothing in common with {@link FeatureTree feature trees} used for determination.
65 * A standard set of feature instances will be automatically
66 * created as the project starts. But this class allows to extend this standard
67 * set by creating new instances of additional features if needed.<BR>
69 * This class corresponds to DescriptionsSectionType according to the SDD
74 * @created 08-Nov-2007 13:06:24
76 @XmlAccessorType(XmlAccessType
.PROPERTY
)
77 @XmlType(name
="Feature", factoryMethod
="NewInstance", propOrder
= {
83 "supportsQuantitativeData",
84 "supportsDistribution",
85 "supportsIndividualAssociation",
86 "supportsTaxonInteraction",
87 "supportsCommonTaxonName",
88 "supportsCategoricalData",
89 "recommendedModifierEnumeration",
90 "recommendedStatisticalMeasures",
91 "supportedCategoricalEnumerations",
92 "recommendedMeasurementUnits"
94 @XmlRootElement(name
= "Feature")
96 @Indexed(index
= "eu.etaxonomy.cdm.model.common.DefinedTermBase")
98 public class Feature
extends DefinedTermBase
<Feature
> {
99 private static final long serialVersionUID
= 6754598791831848704L;
100 private static final Logger logger
= Logger
.getLogger(Feature
.class);
101 private static Feature IMAGE
;
102 private static Feature CULTIVATION
;
103 private static Feature CONSERVATION
;
104 private static Feature USES
;
105 private static Feature ADDITIONAL_PUBLICATION
;
106 private static Feature CITATION
;
107 private static Feature OCCURRENCE
;
108 private static Feature PHENOLOGY
;
109 private static Feature COMMON_NAME
;
110 private static Feature PROTOLOG
;
111 private static Feature INTRODUCTION
;
112 private static Feature DIAGNOSIS
;
113 private static Feature ETYMOLOGY
;
114 private static Feature MATERIALS_METHODS
;
115 private static Feature MATERIALS_EXAMINED
;
116 private static Feature KEY
;
117 private static Feature BIOLOGY_ECOLOGY
;
118 private static Feature ECOLOGY
;
119 private static Feature DISCUSSION
;
120 private static Feature DISTRIBUTION
;
121 private static Feature DESCRIPTION
;
122 private static Feature UNKNOWN
;
124 @XmlElement(name
= "SupportsTextData")
125 private boolean supportsTextData
;
127 @XmlElement(name
= "SupportsQuantitativeData")
128 private boolean supportsQuantitativeData
;
130 @XmlElement(name
= "SupportsDistribution")
131 private boolean supportsDistribution
;
133 @XmlElement(name
= "SupportsIndividualAssociation")
134 private boolean supportsIndividualAssociation
;
136 @XmlElement(name
= "SupportsTaxonInteraction")
137 private boolean supportsTaxonInteraction
;
139 @XmlElement(name
= "SupportsCategoricalData")
140 private boolean supportsCategoricalData
;
143 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique modifier enums?
145 @XmlElementWrapper(name
= "RecommendedModifierEnumerations")
146 @XmlElement(name
= "RecommendedModifierEnumeration")
148 @XmlSchemaType(name
= "IDREF")
149 @OneToMany(fetch
= FetchType
.LAZY
)
150 @JoinTable(name
="DefinedTermBase_RecommendedModifierEnumeration")
151 private Set
<TermVocabulary
<Modifier
>> recommendedModifierEnumeration
= new HashSet
<TermVocabulary
<Modifier
>>();
153 @XmlElementWrapper(name
= "RecommendedStatisticalMeasures")
154 @XmlElement(name
= "RecommendedStatisticalMeasure")
156 @XmlSchemaType(name
= "IDREF")
157 @ManyToMany(fetch
= FetchType
.LAZY
)
158 @JoinTable(name
="DefinedTermBase_StatisticalMeasure")
159 private Set
<StatisticalMeasure
> recommendedStatisticalMeasures
= new HashSet
<StatisticalMeasure
>();
162 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique state enums?
164 @XmlElementWrapper(name
= "SupportedCategoricalEnumerations")
165 @XmlElement(name
= "SupportedCategoricalEnumeration")
167 @XmlSchemaType(name
= "IDREF")
168 @OneToMany(fetch
= FetchType
.LAZY
)
169 @JoinTable(name
="DefinedTermBase_SupportedCategoricalEnumeration")
170 private Set
<TermVocabulary
<State
>> supportedCategoricalEnumerations
= new HashSet
<TermVocabulary
<State
>>();
171 @XmlElement(name
= "SupportsCommonTaxonName")
172 private boolean supportsCommonTaxonName
;
174 @XmlElementWrapper(name
= "RecommendedMeasurementUnits")
175 @XmlElement(name
= "RecommendedMeasurementUnit")
177 @XmlSchemaType(name
= "IDREF")
178 @ManyToMany(fetch
= FetchType
.LAZY
)
179 @JoinTable(name
="DefinedTermBase_MeasurementUnit")
180 private Set
<MeasurementUnit
> recommendedMeasurementUnits
= new HashSet
<MeasurementUnit
>();
182 /* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
186 * Class constructor: creates a new empty feature instance.
188 * @see #Feature(String, String, String)
195 * Class constructor: creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
196 * a label and a label abbreviation.
198 * @param term the string (in the default language) describing the
199 * new feature to be created
200 * @param label the string identifying the new feature to be created
201 * @param labelAbbrev the string identifying (in abbreviated form) the
202 * new feature to be created
205 protected Feature(String term
, String label
, String labelAbbrev
) {
206 super(term
, label
, labelAbbrev
);
210 * Creates a new empty feature instance.
212 * @see #NewInstance(String, String, String)
214 public static Feature
NewInstance() {
215 return new Feature();
219 * Creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
220 * a label and a label abbreviation.
222 * @param term the string (in the default language) describing the
223 * new feature to be created
224 * @param label the string identifying the new feature to be created
225 * @param labelAbbrev the string identifying (in abbreviated form) the
226 * new feature to be created
227 * @see #readCsvLine(List, Language)
228 * @see #NewInstance()
230 public static Feature
NewInstance(String term
, String label
, String labelAbbrev
){
231 return new Feature(term
, label
, labelAbbrev
);
234 /* *************************************************************************************/
237 * Returns the boolean value of the flag indicating whether <i>this</i>
238 * feature can be described with {@link QuantitativeData quantitative data} (true)
239 * or not (false). If this flag is set <i>this</i> feature can only apply to
240 * {@link TaxonDescription taxon descriptions} or {@link SpecimenDescription specimen descriptions}.
242 * @return the boolean value of the supportsQuantitativeData flag
244 public boolean supportsQuantitativeData() {
245 return supportsQuantitativeData
;
249 * @see #isSupportsQuantitativeData()
251 public void setSupportsQuantitativeData(boolean supportsQuantitativeData
) {
252 this.supportsQuantitativeData
= supportsQuantitativeData
;
256 * Returns the boolean value of the flag indicating whether <i>this</i>
257 * feature can be described with {@link TextData text data} (true)
260 * @return the boolean value of the supportsTextData flag
262 public boolean supportsTextData() {
263 return supportsTextData
;
267 * @see #isSupportsTextData()
269 public void setSupportsTextData(boolean supportsTextData
) {
270 this.supportsTextData
= supportsTextData
;
274 * Returns the boolean value of the flag indicating whether <i>this</i>
275 * feature can be described with {@link Distribution distribution} objects
276 * (true) or not (false). This flag is set if and only if <i>this</i> feature
277 * is the {@link #DISTRIBUTION() distribution feature}.
279 * @return the boolean value of the supportsDistribution flag
281 public boolean supportsDistribution() {
282 return supportsDistribution
;
286 * @see #isSupportsDistribution()
288 public void setSupportsDistribution(boolean supportsDistribution
) {
289 this.supportsDistribution
= supportsDistribution
;
293 * Returns the boolean value of the flag indicating whether <i>this</i>
294 * feature can be described with {@link IndividualsAssociation individuals associations}
295 * (true) or not (false).
297 * @return the boolean value of the supportsIndividualAssociation flag
299 public boolean supportsIndividualAssociation() {
300 return supportsIndividualAssociation
;
304 * @see #isSupportsIndividualAssociation()
306 public void setSupportsIndividualAssociation(
307 boolean supportsIndividualAssociation
) {
308 this.supportsIndividualAssociation
= supportsIndividualAssociation
;
312 * Returns the boolean value of the flag indicating whether <i>this</i>
313 * feature can be described with {@link TaxonInteraction taxon interactions}
314 * (true) or not (false).
316 * @return the boolean value of the supportsTaxonInteraction flag
318 public boolean supportsTaxonInteraction() {
319 return supportsTaxonInteraction
;
323 * @see #isSupportsTaxonInteraction()
325 public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction
) {
326 this.supportsTaxonInteraction
= supportsTaxonInteraction
;
330 * Returns the boolean value of the flag indicating whether <i>this</i>
331 * feature can be described with {@link CommonTaxonName common names}
332 * (true) or not (false). This flag is set if and only if <i>this</i> feature
333 * is the {@link #COMMON_NAME() common name feature}.
335 * @return the boolean value of the supportsCommonTaxonName flag
337 public boolean supportsCommonTaxonName() {
338 return supportsCommonTaxonName
;
342 * @see #isSupportsTaxonInteraction()
344 public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName
) {
345 this.supportsCommonTaxonName
= supportsCommonTaxonName
;
349 * Returns the boolean value of the flag indicating whether <i>this</i>
350 * feature can be described with {@link CategoricalData categorical data}
351 * (true) or not (false).
353 * @return the boolean value of the supportsCategoricalData flag
355 public boolean supportsCategoricalData() {
356 return supportsCategoricalData
;
360 * @see #supportsCategoricalData()
362 public void setSupportsCategoricalData(boolean supportsCategoricalData
) {
363 this.supportsCategoricalData
= supportsCategoricalData
;
368 * Returns the set of {@link TermVocabulary term vocabularies} containing the
369 * {@link Modifier modifiers} recommended to be used for {@link DescriptionElementBase description elements}
370 * with <i>this</i> feature.
373 public Set
<TermVocabulary
<Modifier
>> getRecommendedModifierEnumeration() {
374 return recommendedModifierEnumeration
;
378 * Adds a {@link TermVocabulary term vocabulary} (with {@link Modifier modifiers}) to the set of
379 * {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies} assigned
380 * to <i>this</i> feature.
382 * @param recommendedModifierEnumeration the term vocabulary to be added
383 * @see #getRecommendedModifierEnumeration()
385 public void addRecommendedModifierEnumeration(
386 TermVocabulary
<Modifier
> recommendedModifierEnumeration
) {
387 this.recommendedModifierEnumeration
.add(recommendedModifierEnumeration
);
390 * Removes one element from the set of {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies}
391 * assigned to <i>this</i> feature.
393 * @param recommendedModifierEnumeration the term vocabulary which should be removed
394 * @see #getRecommendedModifierEnumeration()
395 * @see #addRecommendedModifierEnumeration(TermVocabulary)
397 public void removeRecommendedModifierEnumeration(
398 TermVocabulary
<Modifier
> recommendedModifierEnumeration
) {
399 this.recommendedModifierEnumeration
.remove(recommendedModifierEnumeration
);
403 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
404 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
406 public Set
<StatisticalMeasure
> getRecommendedStatisticalMeasures() {
407 return recommendedStatisticalMeasures
;
411 * Adds a {@link StatisticalMeasure statistical measure} to the set of
412 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
413 * to <i>this</i> feature.
415 * @param recommendedStatisticalMeasure the statistical measure to be added
416 * @see #getRecommendedStatisticalMeasures()
418 public void addRecommendedStatisticalMeasure(
419 StatisticalMeasure recommendedStatisticalMeasure
) {
420 this.recommendedStatisticalMeasures
.add(recommendedStatisticalMeasure
);
423 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
424 * assigned to <i>this</i> feature.
426 * @param recommendedStatisticalMeasure the statistical measure which should be removed
427 * @see #getRecommendedStatisticalMeasures()
428 * @see #addRecommendedStatisticalMeasure(StatisticalMeasure)
430 public void removeRecommendedStatisticalMeasure(
431 StatisticalMeasure recommendedStatisticalMeasure
) {
432 this.recommendedStatisticalMeasures
.remove(recommendedStatisticalMeasure
);
436 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
437 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
439 public Set
<MeasurementUnit
> getRecommendedMeasurementUnits() {
440 return recommendedMeasurementUnits
;
444 * Adds a {@link StatisticalMeasure statistical measure} to the set of
445 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
446 * to <i>this</i> feature.
448 * @param recommendedStatisticalMeasure the statistical measure to be added
449 * @see #getRecommendedStatisticalMeasures()
451 public void addRecommendedMeasurementUnit(
452 MeasurementUnit recommendedMeasurementUnit
) {
453 this.recommendedMeasurementUnits
.add(recommendedMeasurementUnit
);
456 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
457 * assigned to <i>this</i> feature.
459 * @param recommendedStatisticalMeasure the statistical measure which should be removed
460 * @see #getRecommendedStatisticalMeasures()
461 * @see #addRecommendedStatisticalMeasure(StatisticalMeasure)
463 public void removeRecommendedMeasurementUnit(
464 MeasurementUnit recommendedMeasurementUnit
) {
465 this.recommendedMeasurementUnits
.remove(recommendedMeasurementUnit
);
469 * Returns the set of {@link TermVocabulary term vocabularies} containing the list of
470 * possible {@link State states} to be used in {@link CategoricalData categorical data}
471 * with <i>this</i> feature.
474 public Set
<TermVocabulary
<State
>> getSupportedCategoricalEnumerations() {
475 return supportedCategoricalEnumerations
;
479 * Adds a {@link TermVocabulary term vocabulary} to the set of
480 * {@link #getSupportedCategoricalEnumerations() supported state vocabularies} assigned
481 * to <i>this</i> feature.
483 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
484 * @see #getSupportedCategoricalEnumerations()
486 public void addSupportedCategoricalEnumeration(
487 TermVocabulary
<State
> supportedCategoricalEnumeration
) {
488 this.supportedCategoricalEnumerations
.add(supportedCategoricalEnumeration
);
491 * Removes one element from the set of {@link #getSupportedCategoricalEnumerations() supported state vocabularies}
492 * assigned to <i>this</i> feature.
494 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
495 * @see #getSupportedCategoricalEnumerations()
496 * @see #addSupportedCategoricalEnumeration(TermVocabulary)
498 public void removeSupportedCategoricalEnumeration(
499 TermVocabulary
<State
> supportedCategoricalEnumeration
) {
500 this.supportedCategoricalEnumerations
.remove(supportedCategoricalEnumeration
);
503 @XmlElement(name
= "KindOf", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
505 @XmlSchemaType(name
= "IDREF")
506 public Feature
getKindOf(){
507 return super.getKindOf();
510 public void setKindOf(Feature kindOf
){
511 super.setKindOf(kindOf
);
514 @XmlElement(name
= "PartOf", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
516 @XmlSchemaType(name
= "IDREF")
517 public Feature
getPartOf(){
518 return super.getPartOf();
521 public void setPartOf(Feature partOf
){
522 super.setPartOf(partOf
);
525 @XmlElementWrapper(name
= "Generalizations", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
526 @XmlElement(name
= "GeneralizationOf", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
528 @XmlSchemaType(name
= "IDREF")
529 public Set
<Feature
> getGeneralizationOf(){
530 return super.getGeneralizationOf();
533 protected void setGeneralizationOf(Set
<Feature
> value
){
534 super.setGeneralizationOf(value
);
537 @XmlElementWrapper(name
= "Includes", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
538 @XmlElement(name
= "Include", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
540 @XmlSchemaType(name
= "IDREF")
541 public Set
<Feature
> getIncludes(){
542 return super.getIncludes();
545 protected void setIncludes(Set
<Feature
> includes
) {
546 super.setIncludes(includes
);
549 private static final UUID uuidUnknown
= UUID
.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c");
550 private static final UUID uuidDescription
= UUID
.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493");
551 private static final UUID uuidDistribution
= UUID
.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6");
552 private static final UUID uuidEcology
= UUID
.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b");
553 private static final UUID uuidBiologyEcology
= UUID
.fromString("9832e24f-b670-43b4-ac7c-20a7261a1d8c");
554 private static final UUID uuidKey
= UUID
.fromString("a677f827-22b9-4205-bb37-11cb48dd9106");
555 private static final UUID uuidMaterialsExamined
= UUID
.fromString("7c0c7571-a864-47c1-891d-01f59000dae1");
556 private static final UUID uuidMaterialsMethods
= UUID
.fromString("1e87d9c3-0844-4a03-9686-773e2ccb3ab6");
557 private static final UUID uuidEtymology
= UUID
.fromString("dd653d48-355c-4aec-a4e7-724f6eb29f8d");
558 private static final UUID uuidDiagnosis
= UUID
.fromString("d43d8501-ceab-4caa-9e51-e87138528fac");
559 private static final UUID uuidProtolog
= UUID
.fromString("7f1fd111-fc52-49f0-9e75-d0097f576b2d");
560 private static final UUID uuidCommonName
= UUID
.fromString("fc810911-51f0-4a46-ab97-6562fe263ae5");
561 private static final UUID uuidPhenology
= UUID
.fromString("a7786d3e-7c58-4141-8416-346d4c80c4a2");
562 private static final UUID uuidOccurrence
= UUID
.fromString("5deff505-1a32-4817-9a74-50e6936fd630");
563 private static final UUID uuidCitation
= UUID
.fromString("99b2842f-9aa7-42fa-bd5f-7285311e0101");
564 private static final UUID uuidAdditionalPublication
= UUID
.fromString("cb2eab09-6d9d-4e43-8ad2-873f23400930");
565 private static final UUID uuidUses
= UUID
.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6");
566 private static final UUID uuidConservation
= UUID
.fromString("4518fc20-2492-47de-b345-777d2b83c9cf");
567 private static final UUID uuidCultivation
= UUID
.fromString("e28965b2-a367-48c5-b954-8afc8ac2c69b");
568 private static final UUID uuidIntroduction
= UUID
.fromString("e75255ca-8ff4-4905-baad-f842927fe1d3");
569 private static final UUID uuidDiscussion
= UUID
.fromString("d3c4cbb6-0025-4322-886b-cd0156753a25");
570 private static final UUID uuidImage
= UUID
.fromString("84193b2c-327f-4cce-90ef-c8da18fd5bb5");
573 // private static final UUID uuidDistribution = UUID.fromString("");
574 // private static final UUID uuidDistribution = UUID.fromString("");
575 // private static final UUID uuidDistribution = UUID.fromString("");
577 // "86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract"
578 // "489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis"
579 // "89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple"
580 // "555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments"
584 * Creates and returns a new feature instance on the basis of a given string
585 * list (containing an UUID, an URI, a label and a description) and a given
586 * {@link Language language} to be associated with the description. Furthermore
587 * the flags concerning the supported subclasses of {@link DescriptionElementBase description elements}
588 * are set according to a particular string belonging to the given
590 * This method overrides the readCsvLine method from {@link DefinedTermBase#readCsvLine(List, Language) DefinedTermBase}.
592 * @param csvLine the string list with elementary information for attributes
593 * @param lang the language in which the description has been formulated
594 * @see #NewInstance(String, String, String)
597 public Feature
readCsvLine(Class
<Feature
> termClass
, List
<String
> csvLine
, Map
<UUID
,DefinedTermBase
> terms
) {
598 Feature newInstance
= super.readCsvLine(termClass
, csvLine
, terms
);
599 String text
= (String
)csvLine
.get(4);
600 if (text
!= null && text
.length() >= 6){
601 if ("1".equals(text
.substring(0, 1))){newInstance
.setSupportsTextData(true);};
602 if ("1".equals(text
.substring(1, 2))){newInstance
.setSupportsQuantitativeData(true);};
603 if ("1".equals(text
.substring(2, 3))){newInstance
.setSupportsDistribution(true);};
604 if ("1".equals(text
.substring(3, 4))){newInstance
.setSupportsIndividualAssociation(true);};
605 if ("1".equals(text
.substring(4, 5))){newInstance
.setSupportsTaxonInteraction(true);};
606 if ("1".equals(text
.substring(5, 6))){newInstance
.setSupportsCommonTaxonName(true);};
607 // if ("1".equals(text.substring(6, 7))){newInstance.setSupportsCategoricalData(true);};
613 * Returns the "unknown" feature. This feature allows to store values of
614 * {@link DescriptionElementBase description elements} even if it is momentarily
615 * not known what they mean.
617 public static final Feature
UNKNOWN(){
622 * Returns the "description" feature. This feature allows to handle global
623 * {@link DescriptionElementBase description elements} for a global {@link DescriptionBase description}.<BR>
624 * The "description" feature is the highest level feature.
626 public static final Feature
DESCRIPTION(){
631 * Returns the "distribution" feature. This feature allows to handle only
632 * {@link Distribution distributions}.
634 * @see #isSupportsDistribution()
636 public static final Feature
DISTRIBUTION(){
641 * Returns the "discussion" feature. This feature can only be described
642 * with {@link TextData text data}.
644 * @see #isSupportsTextData()
646 public static final Feature
DISCUSSION(){
651 * Returns the "ecology" feature. This feature only applies
652 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
653 * The "ecology" feature generalizes all other possible features concerning
654 * ecological matters.
656 public static final Feature
ECOLOGY(){
661 * Returns the "biology_ecology" feature. This feature only applies
662 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
663 * The "biology_ecology" feature generalizes all possible features concerning
664 * biological aspects of ecological matters.
668 public static final Feature
BIOLOGY_ECOLOGY(){
669 return BIOLOGY_ECOLOGY
;
673 * Returns the "key" feature. This feature is the "upper" feature generalizing
674 * all features being used within an identification key.
676 public static final Feature
KEY(){
682 * Returns the "materials_examined" feature. This feature can only be described
683 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
684 * mentioning which material has been examined in order to accomplish
685 * the description. This feature applies only to
686 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
688 public static final Feature
MATERIALS_EXAMINED(){
689 return MATERIALS_EXAMINED
;
693 * Returns the "materials_methods" feature. This feature can only be described
694 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
695 * mentioning which methods have been adopted to analyze the material in
696 * order to accomplish the description. This feature applies only to
697 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
699 public static final Feature
MATERIALS_METHODS(){
700 return MATERIALS_METHODS
;
704 * Returns the "etymology" feature. This feature can only be described
705 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
706 * giving some information about the history of the taxon name. This feature applies only to
707 * {@link TaxonNameDescription taxon name descriptions}.
709 public static final Feature
ETYMOLOGY(){
714 * Returns the "diagnosis" feature. This feature can only be described
715 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}.
716 * This feature applies only to {@link SpecimenDescription specimen descriptions} or to
717 * {@link TaxonDescription taxon descriptions}.
719 public static final Feature
DIAGNOSIS(){
725 * Returns the "introduction" feature. This feature can only be described
726 * with {@link TextData text data}.
728 * @see #isSupportsTextData()
730 public static final Feature
INTRODUCTION(){
735 * Returns the "protologue" feature. This feature can only be described
736 * with {@link TextData text data} reproducing the content of the protologue
737 * (or some information about it) of the taxon name. This feature applies only to
738 * {@link TaxonNameDescription taxon name descriptions}.
740 * @see #isSupportsTextData()
742 public static final Feature
PROTOLOG(){
746 * Returns the "common_name" feature. This feature allows to handle only
747 * {@link CommonTaxonName common names}.
749 * @see #isSupportsCommonTaxonName()
751 public static final Feature
COMMON_NAME(){
756 * Returns the "phenology" feature. This feature can only be described
757 * with {@link CategoricalData categorical data} or eventually with {@link TextData text data}
758 * containing information time about recurring natural phenomena.
759 * This feature only applies to {@link TaxonDescription taxon descriptions}.<BR>
760 * The "phenology" feature generalizes all other possible features
761 * concerning time information about particular natural phenomena
762 * (such as "first flight of butterflies").
764 public static final Feature
PHENOLOGY(){
769 * Returns the "occurrence" feature.
771 public static final Feature
OCCURRENCE(){
776 * Returns the "citation" feature. This feature can only be described
777 * with {@link TextData text data}.
779 * @see #isSupportsTextData()
781 public static final Feature
CITATION(){
786 * Returns the "additional_publication" feature. This feature can only be
787 * described with {@link TextData text data} with information about a
788 * publication where a {@link TaxonNameBase taxon name} has also been published
789 * but which is not the {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference}.
790 * This feature applies only to {@link TaxonNameDescription taxon name descriptions}.
792 * @see #isSupportsTextData()
794 public static final Feature
ADDITIONAL_PUBLICATION(){
795 return ADDITIONAL_PUBLICATION
;
800 * Returns the "uses" feature. This feature only applies
801 * to {@link TaxonDescription taxon descriptions}.<BR>
802 * The "uses" feature generalizes all other possible features concerning
803 * particular uses (for instance "industrial use of seeds").
805 public static final Feature
USES(){
811 * Returns the "conservation" feature. This feature only applies
812 * to {@link SpecimenDescription specimen descriptions} and generalizes
813 * methods and conditions for the conservation of {@link Specimen specimens}.<BR>
815 public static final Feature
CONSERVATION(){
821 * Returns the "cultivation" feature.
823 public static final Feature
CULTIVATION(){
829 * Returns the "cultivation" feature.
831 public static final Feature
IMAGE(){
836 * Returns the "hybrid_parent" feature. This feature can only be used
837 * by {@link TaxonInteraction taxon interactions}.<BR>
839 * Note: It must be distinguished between hybrid relationships as
840 * relevant nomenclatural relationships between {@link BotanicalName plant names}
841 * on the one side and the biological relation between two {@link Taxon taxa}
842 * as it is here the case on the other one.
844 * @see #isSupportsTaxonInteraction()
845 * @see HybridRelationshipType
847 public static final Feature
HYBRID_PARENT(){
849 logger
.warn("HYBRID_PARENT not yet implemented");
854 protected void setDefaultTerms(TermVocabulary
<Feature
> termVocabulary
) {
855 Feature
.ADDITIONAL_PUBLICATION
= termVocabulary
.findTermByUuid(Feature
.uuidAdditionalPublication
);
856 Feature
.BIOLOGY_ECOLOGY
= termVocabulary
.findTermByUuid(Feature
.uuidBiologyEcology
);
857 Feature
.CITATION
= termVocabulary
.findTermByUuid(Feature
.uuidCitation
);
858 Feature
.COMMON_NAME
= termVocabulary
.findTermByUuid(Feature
.uuidCommonName
);
859 Feature
.CONSERVATION
= termVocabulary
.findTermByUuid(Feature
.uuidConservation
);
860 Feature
.CULTIVATION
= termVocabulary
.findTermByUuid(Feature
.uuidCultivation
);
861 Feature
.DESCRIPTION
= termVocabulary
.findTermByUuid(Feature
.uuidDescription
);
862 Feature
.DIAGNOSIS
= termVocabulary
.findTermByUuid(Feature
.uuidDiagnosis
);
863 Feature
.DISCUSSION
= termVocabulary
.findTermByUuid(Feature
.uuidDiscussion
);
864 Feature
.DISTRIBUTION
= termVocabulary
.findTermByUuid(Feature
.uuidDistribution
);
865 Feature
.ECOLOGY
= termVocabulary
.findTermByUuid(Feature
.uuidEcology
);
866 Feature
.ETYMOLOGY
= termVocabulary
.findTermByUuid(Feature
.uuidEtymology
);
867 Feature
.IMAGE
= termVocabulary
.findTermByUuid(Feature
.uuidImage
);
868 Feature
.INTRODUCTION
= termVocabulary
.findTermByUuid(Feature
.uuidIntroduction
);
869 Feature
.KEY
= termVocabulary
.findTermByUuid(Feature
.uuidKey
);
870 Feature
.MATERIALS_EXAMINED
= termVocabulary
.findTermByUuid(Feature
.uuidMaterialsExamined
);
871 Feature
.MATERIALS_METHODS
= termVocabulary
.findTermByUuid(Feature
.uuidMaterialsMethods
);
872 Feature
.OCCURRENCE
= termVocabulary
.findTermByUuid(Feature
.uuidOccurrence
);
873 Feature
.PHENOLOGY
= termVocabulary
.findTermByUuid(Feature
.uuidPhenology
);
874 Feature
.PROTOLOG
= termVocabulary
.findTermByUuid(Feature
.uuidProtolog
);
875 Feature
.UNKNOWN
= termVocabulary
.findTermByUuid(Feature
.uuidUnknown
);
876 Feature
.USES
= termVocabulary
.findTermByUuid(Feature
.uuidUses
);