Finished Jaxb annotations for common and description packages.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / Sex.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.UUID;
14
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;
20
21 import org.apache.log4j.Logger;
22
23 import eu.etaxonomy.cdm.model.common.Language;
24 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
25
26 /**
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.
32 *
33 * @author m.doering
34 * @version 1.0
35 * @created 08-Nov-2007 13:06:52
36 */
37 @XmlAccessorType(XmlAccessType.FIELD)
38 @XmlType(name = "Sex")
39 @XmlRootElement(name = "Sex")
40 @Entity
41 public class Sex extends Scope {
42 private static final Logger logger = Logger.getLogger(Sex.class);
43
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");
46
47
48 public static final Sex getByUuid(UUID uuid){
49 return (Sex) findByUuid(uuid);
50 }
51
52
53 /**
54 * Class constructor: creates a new empty sex instance.
55 *
56 * @see #Sex(String, String, String)
57 */
58 public Sex() {
59 super();
60 }
61
62 /**
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.
65 *
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
71 * @see #Sex()
72 */
73 public Sex(String term, String label, String labelAbbrev) {
74 super(term, label, labelAbbrev);
75 }
76
77 /**
78 * Creates a new empty sex instance.
79 *
80 * @see #Sex(String, String, String)
81 */
82 public static Sex NewInstance(){
83 return new Sex();
84 }
85
86 public static Sex MALE(){
87 return getByUuid(uuidMale);
88 }
89
90 public static Sex FEMALE(){
91 return getByUuid(uuidFemale);
92 }
93
94
95 }