(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / Representation.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.model.common;
11
12
13 import org.apache.log4j.Logger;
14
15 import java.util.*;
16 import javax.persistence.*;
17
18 /**
19 * workaround for enumerations
20 * @author m.doering
21 * @version 1.0
22 * @created 08-Nov-2007 13:06:49
23 */
24 @Entity
25 public class Representation extends LanguageString {
26 static Logger logger = Logger.getLogger(Representation.class);
27
28 private String label;
29 private String abbreviatedLabel;
30
31 public Representation() {
32 super();
33 }
34 public Representation(String text, String label, Language lang) {
35 super(text, lang);
36 this.label = label;
37 }
38
39
40 public String getLabel(){
41 return this.label;
42 }
43 public void setLabel(String label){
44 this.label = label;
45 }
46
47 public String getAbbreviatedLabel(){
48 return this.abbreviatedLabel;
49 }
50 public void setAbbreviatedLabel(String abbreviatedLabel){
51 this.abbreviatedLabel = abbreviatedLabel;
52 }
53
54 @Transient
55 public String getDescription(){
56 return super.getText();
57 }
58 protected void setDescription(String text) {
59 super.setText(text);
60 }
61
62 public String toString(){
63 // we dont need the language returned too, do we?
64 return getLabel();
65 // if(getLanguage()==null || getLanguage().getLabel()==null){
66 // return getLabel();
67 // }else{
68 // return getLabel()+"("+ getLanguage().getLabel()+")";
69 // }
70 }
71 }