merge-update from trunk
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / LanguageString.java
index 503baa6482c7f22007117c05c9747798db32deaa..985c561edf220af6b92a01a040da953a6d6d8a1b 100644 (file)
@@ -12,24 +12,38 @@ package eu.etaxonomy.cdm.model.common;
 import javax.persistence.Entity;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.log4j.Logger;
+import org.hibernate.envers.Audited;
+import org.hibernate.search.annotations.Indexed;
 
 /**
+ * This class is an instantiatable class for the base class {@link LanguageStringBase}.
+ * No further functionality is added.
  * @author m.doering
  * @version 1.0
  * @created 08-Nov-2007 13:06:32
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "LanguageString")
+@XmlRootElement(name = "LanguageString")
 @Entity
-public class LanguageString  extends LanguageStringBase{
-       static Logger logger = Logger.getLogger(LanguageString.class);
+@Indexed(index = "eu.etaxonomy.cdm.model.common.LanguageString")
+@Audited
+public class LanguageString  extends LanguageStringBase implements Cloneable {
+       private static final long serialVersionUID = -1502298496073201104L;
+       @SuppressWarnings("unused")
+       private static final Logger logger = Logger.getLogger(LanguageString.class);
 
+//********************* FACTORY *******************************************/   
+       
        public static LanguageString NewInstance(String text, Language language){
                return new LanguageString(text, language);
        }
+
+// ********************* CONSTRUCTOR ********************************/ 
        
        protected LanguageString() {
                super();
@@ -39,13 +53,12 @@ public class LanguageString  extends LanguageStringBase{
                super(text, language);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.model.common.CdmBase#toString()
-        */
+
+//*************** TO STRING ***********************************/       
        @Override
        public String toString() {
                if (text == null){
-                       return super.toString() + "null";
+                       return super.toString() + ":null";
                }else{
                        String languagePart = "";
                        if (this.language != null){
@@ -58,7 +71,12 @@ public class LanguageString  extends LanguageStringBase{
                        }
                }
        }
-       
-       
+
+// ************************ CLONE ********************************/    
+       @Override
+       public Object clone() throws CloneNotSupportedException {
+               LanguageString result = (LanguageString)super.clone();
+               return result;
+       }
        
 }
\ No newline at end of file