(String label)
| 119 | } |
| 120 | |
| 121 | public String getString(String label) |
| 122 | throws DBException |
| 123 | { |
| 124 | DBElement element = getElement(label); |
| 125 | String value; |
| 126 | if (element != null) { |
| 127 | int fieldType = element.getType(); |
| 128 | if (fieldType == 10) { |
| 129 | value = (String)element.getValue(); |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | if (fieldType == 11) { |
| 134 | value = (String)element.getValue(); |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | if (fieldType == 12) { |
| 139 | LocalizedString string = (LocalizedString)element.getValue(); |
| 140 | if (string.getSubstringCount() > 0) { |
| 141 | LocalizedSubstring substring = string.getSubstring(Main.languageID, 0); |
| 142 | if (substring != null) |
| 143 | value = substring.getString(); |
| 144 | else |
| 145 | value = string.getSubstring(0).getString(); |
| 146 | } else { |
| 147 | int refid = string.getStringReference(); |
| 148 | if (refid >= 0) |
| 149 | value = Main.getString(refid); |
| 150 | else |
| 151 | value = new String(); |
| 152 | } |
| 153 | } else { |
| 154 | throw new DBException("Field " + label + " is not a string"); |
| 155 | } |
| 156 | } |
| 157 | } } else { value = new String(); } |
| 158 | |
| 159 | |
| 160 | return value; |
| 161 | } |
| 162 | |
| 163 | public void setString(String label, String value) |
| 164 | throws DBException |
no test coverage detected