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 javax
.persistence
.Entity
;
13 import javax
.xml
.bind
.annotation
.XmlAccessType
;
14 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
15 import javax
.xml
.bind
.annotation
.XmlRootElement
;
16 import javax
.xml
.bind
.annotation
.XmlType
;
18 import org
.apache
.log4j
.Logger
;
19 import org
.hibernate
.envers
.Audited
;
20 import org
.hibernate
.search
.annotations
.Indexed
;
25 * @created 08-Nov-2007 13:06:32
27 @XmlAccessorType(XmlAccessType
.FIELD
)
28 @XmlType(name
= "LanguageString")
29 @XmlRootElement(name
= "LanguageString")
31 @Indexed(index
= "eu.etaxonomy.cdm.model.common.LanguageStringBase")
33 public class LanguageString
extends LanguageStringBase
implements Cloneable
{
34 private static final long serialVersionUID
= -1502298496073201104L;
35 @SuppressWarnings("unused")
36 private static final Logger logger
= Logger
.getLogger(LanguageString
.class);
38 public static LanguageString
NewInstance(String text
, Language language
){
39 return new LanguageString(text
, language
);
42 protected LanguageString() {
46 protected LanguageString(String text
, Language language
) {
47 super(text
, language
);
51 * @see eu.etaxonomy.cdm.model.common.CdmBase#toString()
54 public String
toString() {
56 return super.toString() + "null";
58 String languagePart
= "";
59 if (this.language
!= null){
60 languagePart
= "(" + this.language
.toString() + ")";
62 if (text
.length() > 20){
63 return text
.substring(0, 20) + "..." + languagePart
;
65 return text
+ languagePart
;
71 public Object
clone() throws CloneNotSupportedException
{
72 LanguageString result
= (LanguageString
)super.clone();