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
.UUID
;
15 import javax
.persistence
.Entity
;
16 import javax
.xml
.bind
.annotation
.XmlAccessType
;
17 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
18 import javax
.xml
.bind
.annotation
.XmlRootElement
;
19 import javax
.xml
.bind
.annotation
.XmlType
;
21 import org
.apache
.log4j
.Logger
;
23 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
24 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
27 * The class representing the restriction concerning the sex for
28 * the applicability of {@link TaxonDescription taxon descriptions}. The sex of a
29 * {@link SpecimenOrObservationBase specimen or observation}
30 * does not belong to a {@link SpecimenDescription specimen description} but is an attribute of
31 * the specimen itself.
35 * @created 08-Nov-2007 13:06:52
37 @XmlAccessorType(XmlAccessType
.FIELD
)
38 @XmlType(name
= "Sex")
39 @XmlRootElement(name
= "Sex")
41 public class Sex
extends Scope
{
42 private static final Logger logger
= Logger
.getLogger(Sex
.class);
44 private static final UUID uuidMale
= UUID
.fromString("600a5212-cc02-431d-8a80-2bf595bd1eab");
45 private static final UUID uuidFemale
= UUID
.fromString("b4cfe0cb-b35c-4f97-9b6b-2b3c096ea2c0");
48 public static final Sex
getByUuid(UUID uuid
){
49 return (Sex
) findByUuid(uuid
);
54 * Class constructor: creates a new empty sex instance.
56 * @see #Sex(String, String, String)
63 * Class constructor: creates a new sex instance with a description
64 * (in the {@link Language#DEFAULT() default language}), a label and a label abbreviation.
66 * @param term the string (in the default language) describing the
67 * new sex to be created
68 * @param label the string identifying the new sex to be created
69 * @param labelAbbrev the string identifying (in abbreviated form) the
70 * new sex to be created
73 public Sex(String term
, String label
, String labelAbbrev
) {
74 super(term
, label
, labelAbbrev
);
78 * Creates a new empty sex instance.
80 * @see #Sex(String, String, String)
82 public static Sex
NewInstance(){
86 public static Sex
MALE(){
87 return getByUuid(uuidMale
);
90 public static Sex
FEMALE(){
91 return getByUuid(uuidFemale
);