java/LangTable/src/cz/frantovo/langtable/Keyboards.java
changeset 20 63b496ae04f9
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/LangTable/src/cz/frantovo/langtable/Keyboards.java	Tue Aug 06 17:51:00 2013 +0200
     1.3 @@ -0,0 +1,149 @@
     1.4 +package cz.frantovo.langtable;
     1.5 +
     1.6 +import java.util.List;
     1.7 +import javax.xml.bind.annotation.XmlElement;
     1.8 +import javax.xml.bind.annotation.XmlElementWrapper;
     1.9 +import javax.xml.bind.annotation.XmlRootElement;
    1.10 +
    1.11 +/**
    1.12 + *
    1.13 + * @author Ing. František Kučera (frantovo.cz)
    1.14 + */
    1.15 +@XmlRootElement
    1.16 +public class Keyboards {
    1.17 +
    1.18 +	private List<Keyboard> keyboards;
    1.19 +
    1.20 +	@XmlElement(name = "keyboard")
    1.21 +	public List<Keyboard> getKeyboards() {
    1.22 +		return keyboards;
    1.23 +	}
    1.24 +
    1.25 +	public void setKeyboards(List<Keyboard> keyboards) {
    1.26 +		this.keyboards = keyboards;
    1.27 +	}
    1.28 +
    1.29 +	public static class Keyboard {
    1.30 +
    1.31 +		private String id;
    1.32 +		private String description;
    1.33 +		private String comment;
    1.34 +		private boolean ascii;
    1.35 +		private List<Language> languages;
    1.36 +		private List<Territory> territories;
    1.37 +
    1.38 +		@XmlElement(name = "keyboardId")
    1.39 +		public String getId() {
    1.40 +			return id;
    1.41 +		}
    1.42 +
    1.43 +		public void setId(String id) {
    1.44 +			this.id = id;
    1.45 +		}
    1.46 +
    1.47 +		@XmlElement
    1.48 +		public String getDescription() {
    1.49 +			return description;
    1.50 +		}
    1.51 +
    1.52 +		public void setDescription(String description) {
    1.53 +			this.description = description;
    1.54 +		}
    1.55 +
    1.56 +		@XmlElement
    1.57 +		public String getComment() {
    1.58 +			return comment;
    1.59 +		}
    1.60 +
    1.61 +		public void setComment(String comment) {
    1.62 +			this.comment = comment;
    1.63 +		}
    1.64 +
    1.65 +		@XmlElement
    1.66 +		public boolean isAscii() {
    1.67 +			return ascii;
    1.68 +		}
    1.69 +
    1.70 +		public void setAscii(boolean ascii) {
    1.71 +			this.ascii = ascii;
    1.72 +		}
    1.73 +
    1.74 +		@XmlElement(name = "language")
    1.75 +		@XmlElementWrapper(name = "languages")
    1.76 +		public List<Language> getLanguages() {
    1.77 +			return languages;
    1.78 +		}
    1.79 +
    1.80 +		public void setLanguages(List<Language> languages) {
    1.81 +			this.languages = languages;
    1.82 +		}
    1.83 +
    1.84 +		@XmlElement(name = "territory")
    1.85 +		@XmlElementWrapper(name = "territories")
    1.86 +		public List<Territory> getTerritories() {
    1.87 +			return territories;
    1.88 +		}
    1.89 +
    1.90 +		public void setTerritories(List<Territory> territories) {
    1.91 +			this.territories = territories;
    1.92 +		}
    1.93 +	}
    1.94 +
    1.95 +	public static class Language {
    1.96 +
    1.97 +		private String id;
    1.98 +		private int rank;
    1.99 +
   1.100 +		@XmlElement(name = "languageId")
   1.101 +		public String getId() {
   1.102 +			return id;
   1.103 +		}
   1.104 +
   1.105 +		public void setId(String id) {
   1.106 +			this.id = id;
   1.107 +		}
   1.108 +
   1.109 +		@XmlElement
   1.110 +		public int getRank() {
   1.111 +			return rank;
   1.112 +		}
   1.113 +
   1.114 +		public void setRank(int rank) {
   1.115 +			this.rank = rank;
   1.116 +		}
   1.117 +
   1.118 +		@Override
   1.119 +		public String toString() {
   1.120 +			return getId() + " (" + getRank() + ")";
   1.121 +		}
   1.122 +	}
   1.123 +
   1.124 +	public static class Territory {
   1.125 +
   1.126 +		private String id;
   1.127 +		private int rank;
   1.128 +
   1.129 +		@XmlElement(name = "territoryId")
   1.130 +		public String getId() {
   1.131 +			return id;
   1.132 +		}
   1.133 +
   1.134 +		public void setId(String id) {
   1.135 +			this.id = id;
   1.136 +		}
   1.137 +
   1.138 +		@XmlElement
   1.139 +		public int getRank() {
   1.140 +			return rank;
   1.141 +		}
   1.142 +
   1.143 +		public void setRank(int rank) {
   1.144 +			this.rank = rank;
   1.145 +		}
   1.146 +
   1.147 +		@Override
   1.148 +		public String toString() {
   1.149 +			return getId() + " (" + getRank() + ")";
   1.150 +		}
   1.151 +	}
   1.152 +}