Finished Jaxb annotations for common and description packages.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / AbsenceTerm.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 org.apache.log4j.Logger;
16
17 import eu.etaxonomy.cdm.model.common.Language;
18 import eu.etaxonomy.cdm.model.location.NamedArea;
19 import eu.etaxonomy.cdm.model.taxon.Taxon;
20
21 import javax.persistence.*;
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlRootElement;
25 import javax.xml.bind.annotation.XmlType;
26
27 /**
28 * This class represents terms describing different types of absence
29 * (like "extinct" or just "absent") of a {@link Taxon taxon} in a {@link NamedArea particular area}.
30 *
31 * @author m.doering
32 * @version 1.0
33 * @created 08-Nov-2007 13:06:08
34 */
35 @XmlAccessorType(XmlAccessType.FIELD)
36 @XmlType(name = "AbsenceTerm")
37 @XmlRootElement(name = "AbsenceTerm")
38 @Entity
39 public class AbsenceTerm extends PresenceAbsenceTermBase<AbsenceTerm> {
40 private static final Logger logger = Logger.getLogger(AbsenceTerm.class);
41
42 /**
43 * Creates a new empty absence term.
44 *
45 * @see #NewInstance(String, String, String)
46 */
47 public static AbsenceTerm NewInstance(){
48 return new AbsenceTerm();
49 }
50
51 /**
52 * Creates a new absence term with a description (in the {@link Language#DEFAULT() default language}),
53 * a label and a label abbreviation.
54 *
55 * @param term the string (in the default language) describing the
56 * new absence term to be created
57 * @param label the string identifying the new absence term to be created
58 * @param labelAbbrev the string identifying (in abbreviated form) the
59 * new absence term to be created
60 * @see #NewInstance()
61 */
62 public static AbsenceTerm NewInstance(String term, String label, String labelAbbrev){
63 return new AbsenceTerm(term, label, labelAbbrev);
64 }
65
66 // ************* CONSTRUCTORS *************/
67 /**
68 * Class constructor: creates a new empty absence term.
69 *
70 * @see #AbsenceTerm(String, String, String)
71 */
72 public AbsenceTerm() {
73 super();
74 }
75
76 /**
77 * Class constructor: creates a new absence term with a description (in the {@link Language#DEFAULT() default language}),
78 * a label and a label abbreviation.
79 *
80 * @param term the string (in the default language) describing the
81 * new absence term to be created
82 * @param label the string identifying the new absence term to be created
83 * @param labelAbbrev the string identifying (in abbreviated form) the
84 * new absence term to be created
85 * @see #AbsenceTerm()
86 */
87 public AbsenceTerm(String term, String label, String labelAbbrev) {
88 super(term, label, labelAbbrev);
89 }
90
91 //********* METHODS **************************************/
92
93 private static final UUID uuidAbsence=UUID.fromString("59709861-f7d9-41f9-bb21-92559cedd598");
94
95
96
97 public static final AbsenceTerm getByUuid(UUID uuid){
98 return (AbsenceTerm)findByUuid(uuid);
99 }
100
101 public static final AbsenceTerm ABSENT(){return getByUuid(uuidAbsence);}
102
103 }