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
.common
;
12 import org
.apache
.log4j
.Logger
;
13 import javax
.persistence
.*;
14 import javax
.xml
.bind
.annotation
.XmlAccessType
;
15 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
16 import javax
.xml
.bind
.annotation
.XmlElement
;
17 import javax
.xml
.bind
.annotation
.XmlIDREF
;
18 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
19 import javax
.xml
.bind
.annotation
.XmlType
;
26 @XmlAccessorType(XmlAccessType
.FIELD
)
27 @XmlType(name
= "LanguageStringBase", propOrder
= {
32 public abstract class LanguageStringBase
extends VersionableEntity
{
34 static Logger logger
= Logger
.getLogger(LanguageStringBase
.class);
36 @XmlElement(name
= "Text")
37 protected String text
;
39 @XmlElement(name
= "Language")
41 @XmlSchemaType(name
= "IDREF")
42 protected Language language
;
44 protected LanguageStringBase() {
48 protected LanguageStringBase(String text
, Language language
) {
50 this.setLanguage(language
);
56 //@Cascade({CascadeType.SAVE_UPDATE})
57 public Language
getLanguage(){
60 public void setLanguage(Language language
){
61 this.language
= language
;
65 public String
getText(){
68 protected void setText(String text
) {
73 public String
getLanguageLabel(){
74 if (language
!= null){
75 return this.language
.getRepresentation(Language
.DEFAULT()).getLabel();
81 public String
getLanguageLabel(Language lang
){
82 if (language
!= null){
83 return this.language
.getRepresentation(lang
).getLabel();