1 package eu
.etaxonomy
.cdm
.model
.description
;
6 import javax
.persistence
.Entity
;
7 import javax
.xml
.bind
.annotation
.XmlAccessType
;
8 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
9 import javax
.xml
.bind
.annotation
.XmlElement
;
10 import javax
.xml
.bind
.annotation
.XmlIDREF
;
11 import javax
.xml
.bind
.annotation
.XmlRootElement
;
12 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
13 import javax
.xml
.bind
.annotation
.XmlType
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.hibernate
.envers
.Audited
;
17 import org
.hibernate
.search
.annotations
.Indexed
;
19 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
21 import eu
.etaxonomy
.cdm
.model
.common
.Representation
;
22 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
24 @XmlAccessorType(XmlAccessType
.PROPERTY
)
25 @XmlType(name
="NaturalLanguageTerm")
26 @XmlRootElement(name
= "NaturalLanguageTerm")
28 @Indexed(index
= "eu.etaxonomy.cdm.model.common.DefinedTermBase")
30 public class NaturalLanguageTerm
extends DefinedTermBase
<NaturalLanguageTerm
> {
31 private static final long serialVersionUID
= 6754598791831848705L;
32 @SuppressWarnings("unused")
33 private static final Logger logger
= Logger
.getLogger(NaturalLanguageTerm
.class);
35 protected static Map
<UUID
, NaturalLanguageTerm
> termMap
= null;
38 private static NaturalLanguageTerm FROM
= new NaturalLanguageTerm();
39 private static NaturalLanguageTerm TO
= new NaturalLanguageTerm();
40 private static NaturalLanguageTerm UP_TO
= new NaturalLanguageTerm();
41 private static NaturalLanguageTerm MOST_FREQUENTLY
= new NaturalLanguageTerm();
42 private static NaturalLanguageTerm ON_AVERAGE
= new NaturalLanguageTerm();
43 private static NaturalLanguageTerm MORE_OR_LESS
= new NaturalLanguageTerm();
45 private static final UUID uuidTo
= UUID
.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb494");
48 protected void setDefaultTerms(
49 TermVocabulary
<NaturalLanguageTerm
> termVocabulary
) {
50 //NaturalLanguageTerm.TO = termVocabulary.findTermByUuid(NaturalLanguageTerm.uuidTo);
51 //NaturalLanguageTerm.TO.setLabel("eip");
55 public NaturalLanguageTerm() {
58 public NaturalLanguageTerm(String term
, String label
, String labelAbbrev
) {
59 super(term
, label
, labelAbbrev
);
64 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
67 public void resetTerms(){
72 @XmlElement(name
= "KindOf", namespace
= "http://etaxonomy.eu/cdm/model/common/1.0")
74 @XmlSchemaType(name
= "IDREF")
76 public NaturalLanguageTerm
getKindOf(){
77 return super.getKindOf();
80 public void setKindOf(NaturalLanguageTerm kindOf
){
81 super.setKindOf(kindOf
);
85 * Returns the "from" term.
87 public static final NaturalLanguageTerm
FROM(){
88 NaturalLanguageTerm nlt
= FROM
;
89 Representation representation
= Representation
.NewInstance("", "from", "", Language
.ENGLISH());
90 Representation representation2
= Representation
.NewInstance("", "de", "", Language
.FRENCH());
91 Representation representation3
= Representation
.NewInstance("", "von", "", Language
.GERMAN());
92 nlt
.addRepresentation(representation
);
93 nlt
.addRepresentation(representation2
);
94 nlt
.addRepresentation(representation3
);
99 * Returns the "to" term.
101 public static final NaturalLanguageTerm
TO(){
102 NaturalLanguageTerm nlt
= TO
;
103 Representation representation
= Representation
.NewInstance("", "to", "", Language
.ENGLISH());
104 Representation representation2
= Representation
.NewInstance("", "\88", "", Language
.FRENCH());
105 nlt
.addRepresentation(representation
);
106 nlt
.addRepresentation(representation2
);
110 public static final NaturalLanguageTerm
UP_TO(){
111 NaturalLanguageTerm nlt
= UP_TO
;
112 Representation representation
= Representation
.NewInstance("", "up to", "", Language
.ENGLISH());
113 Representation representation2
= Representation
.NewInstance("", "jusqu'\88", "", Language
.FRENCH());
114 nlt
.addRepresentation(representation
);
115 nlt
.addRepresentation(representation2
);
119 public static final NaturalLanguageTerm
MOST_FREQUENTLY(){
120 NaturalLanguageTerm nlt
= MOST_FREQUENTLY
;
121 Representation representation
= Representation
.NewInstance("", "most frequently", "", Language
.ENGLISH());
122 Representation representation2
= Representation
.NewInstance("", "plus fr\8equemment", "", Language
.FRENCH());
123 nlt
.addRepresentation(representation
);
124 nlt
.addRepresentation(representation2
);
128 public static final NaturalLanguageTerm
ON_AVERAGE(){
129 NaturalLanguageTerm nlt
= ON_AVERAGE
;
130 Representation representation
= Representation
.NewInstance("", "on average", "", Language
.ENGLISH());
131 Representation representation2
= Representation
.NewInstance("", "en moyenne", "", Language
.FRENCH());
132 nlt
.addRepresentation(representation
);
133 nlt
.addRepresentation(representation2
);
137 public static final NaturalLanguageTerm
MORE_OR_LESS(){
138 NaturalLanguageTerm nlt
= MORE_OR_LESS
;
139 Representation representation
= Representation
.NewInstance("", "+/-", "", Language
.ENGLISH());
140 nlt
.addRepresentation(representation
);