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
;
13 import org
.apache
.log4j
.Logger
;
14 import javax
.persistence
.*;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlElement
;
18 import javax
.xml
.bind
.annotation
.XmlRootElement
;
19 import javax
.xml
.bind
.annotation
.XmlType
;
22 * workaround for enumerations
25 * @created 08-Nov-2007 13:06:49
28 @XmlAccessorType(XmlAccessType
.FIELD
)
29 @XmlType(name
= "Representation", propOrder
= {
33 @XmlRootElement(name
= "Representation")
35 public class Representation
extends LanguageStringBase
{
36 static Logger logger
= Logger
.getLogger(Representation
.class);
38 @XmlElement(name
= "Label")
41 @XmlElement(name
= "AbbreviatedLabel")
42 private String abbreviatedLabel
;
50 public static Representation
NewInstance(String text
, String label
, String abbreviatedLabel
, Language lang
){
51 return new Representation(text
, label
, abbreviatedLabel
, lang
);
54 public Representation() {
57 public Representation(String text
, String label
, String abbreviatedLabel
, Language language
) {
58 super(text
, language
);
63 public String
getLabel(){
66 public void setLabel(String label
){
70 public String
getAbbreviatedLabel(){
71 return this.abbreviatedLabel
;
73 public void setAbbreviatedLabel(String abbreviatedLabel
){
74 this.abbreviatedLabel
= abbreviatedLabel
;
78 public String
getDescription(){
81 protected void setDescription(String text
) {
87 * Overrides super.getText() only to document that here the Text attribute
88 * should be used for a larger description of the label.
92 public String
getText(){
93 return super.getText();
97 public String
toString(){
98 // we dont need the language returned too, do we?
100 // if(getLanguage()==null || getLanguage().getLabel()==null){
101 // return getLabel();
103 // return getLabel()+"("+ getLanguage().getLabel()+")";