import java.util.*;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
/**
* list of languages according to current internet best practices as given by IANA
* @version 1.0
* @created 08-Nov-2007 13:06:31
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Language")
@Entity
@Component
public class Language extends DefinedTermBase {
private static final UUID uuidItalian = UUID.fromString("fecbf0c7-fea9-465b-8a16-950517c5c0c4");
private static final UUID uuidDutch = UUID.fromString("9965d79a-acf9-4921-a2c0-863b8c16c056");
private static final UUID uuidPolish = UUID.fromString("3fdca387-f1b0-4ec1-808f-1bc3dc482194");
+ private static final UUID uuidLatin = UUID.fromString("160a5b6c-87f5-4422-9bda-78cd404c179e");
public static Language NewInstance(){
return new Language();
return new Language(uuid);
}
-
+ @XmlAttribute(name = "iso639_1")
private char[] iso639_1 = new char[2];
+ @XmlAttribute(name = "iso639_2")
private char[] iso639_2 = new char[3];
public Language() {
}
this.iso639_1=iso639_1;
this.iso639_2=iso639_2;
- this.addRepresentation(new Representation(englishLabel, String.valueOf(iso639_2), Language.ENGLISH()));
- this.addRepresentation(new Representation(frenchLabel, String.valueOf(iso639_2), Language.FRENCH()));
+ String textEnglish = englishLabel;
+ String textFrench = englishLabel;
+ String label = String.valueOf(iso639_2);
+ String labelAbbrev = null;
+ this.addRepresentation(new Representation(textEnglish, label, labelAbbrev, Language.ENGLISH()));
+ this.addRepresentation(new Representation(textFrench, label, labelAbbrev, Language.FRENCH()));
}
- public Language(String text, String label, Language lang) {
+ public Language(String text, String label, String labelAbbrev, Language lang) {
super();
- this.addRepresentation(new Representation(text,label,lang));
+ this.addRepresentation(new Representation(text,label,labelAbbrev, lang));
}
- public Language(String label, String text) {
- this(label,text, DEFAULT());
+ public Language(String label, String text, String labelAbbrev) {
+ this(label,text,labelAbbrev, DEFAULT());
}
public static final Language getByUuid(UUID uuid){
return getByUuid(uuidPolish);
}
+ public static final Language LATIN(){
+ return getByUuid(uuidLatin);
+ }
+
/**
* Get the according iso639-1 alpha-2 language code
* http://www.loc.gov/standards/iso639-2/