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
;
23 * This class is an instantiatable class for the base class {@link LanguageStringBase}.
24 * No further functionality is added.
27 * @created 08-Nov-2007 13:06:32
29 @XmlAccessorType(XmlAccessType
.FIELD
)
30 @XmlType(name
= "LanguageString")
31 @XmlRootElement(name
= "LanguageString")
33 @Indexed(index
= "eu.etaxonomy.cdm.model.common.LanguageString")
35 public class LanguageString
extends LanguageStringBase
implements Cloneable
{
36 private static final long serialVersionUID
= -1502298496073201104L;
37 @SuppressWarnings("unused")
38 private static final Logger logger
= Logger
.getLogger(LanguageString
.class);
40 //********************* FACTORY *******************************************/
42 public static LanguageString
NewInstance(String text
, Language language
){
43 return new LanguageString(text
, language
);
46 // ********************* CONSTRUCTOR ********************************/
48 protected LanguageString() {
52 protected LanguageString(String text
, Language language
) {
53 super(text
, language
);
57 //*************** TO STRING ***********************************/
59 public String
toString() {
61 return super.toString() + ":null";
63 String languagePart
= "";
64 if (this.language
!= null){
65 languagePart
= "(" + this.language
.toString() + ")";
67 if (text
.length() > 20){
68 return text
.substring(0, 20) + "..." + languagePart
;
70 return text
+ languagePart
;
75 // ************************ CLONE ********************************/
77 public Object
clone() throws CloneNotSupportedException
{
78 LanguageString result
= (LanguageString
)super.clone();