(final String line)
| 4190 | * ############################################################### |
| 4191 | */ |
| 4192 | private void parseStatLine(final String line) throws PCGParseException |
| 4193 | { |
| 4194 | final PCGTokenizer tokens; |
| 4195 | |
| 4196 | try |
| 4197 | { |
| 4198 | tokens = new PCGTokenizer(line); |
| 4199 | } |
| 4200 | catch (PCGParseException pcgpex) |
| 4201 | { |
| 4202 | /* |
| 4203 | * Ability scores are critical for characters, |
| 4204 | * need to stop the load process |
| 4205 | * |
| 4206 | * Thomas Behr 09-09-02 |
| 4207 | */ |
| 4208 | throw new PCGParseException("parseStatLine", line, pcgpex.getMessage(), pcgpex); //$NON-NLS-1$ |
| 4209 | } |
| 4210 | |
| 4211 | final Iterator<PCGElement> it = tokens.getElements().iterator(); |
| 4212 | |
| 4213 | if (it.hasNext()) |
| 4214 | { |
| 4215 | PCGElement element = it.next(); |
| 4216 | final String statName = element.getText(); |
| 4217 | PCStat stat = |
| 4218 | Globals.getContext().getReferenceContext().silentlyGetConstructedCDOMObject(PCStat.class, statName); |
| 4219 | |
| 4220 | if ((stat != null) && seenStats.add(statName.toUpperCase()) && (it.hasNext())) |
| 4221 | { |
| 4222 | element = it.next(); |
| 4223 | |
| 4224 | try |
| 4225 | { |
| 4226 | thePC.setStat(stat, Integer.parseInt(element.getText())); |
| 4227 | } |
| 4228 | catch (NumberFormatException nfe) |
| 4229 | { |
| 4230 | throw new PCGParseException("parseStatLine", line, nfe.getMessage(), nfe); //$NON-NLS-1$ |
| 4231 | } |
| 4232 | } |
| 4233 | else |
| 4234 | { |
| 4235 | final String message = "Invalid attribute specification. " + "Cannot load character."; |
| 4236 | throw new PCGParseException("parseStatLine", line, message, null); //$NON-NLS-1$ |
| 4237 | } |
| 4238 | } |
| 4239 | else |
| 4240 | { |
| 4241 | final String message = "Invalid attribute specification. " + "Cannot load character."; |
| 4242 | throw new PCGParseException("parseStatLine", line, message, null); //$NON-NLS-1$ |
| 4243 | } |
| 4244 | } |
| 4245 | |
| 4246 | private void parseTabNameLine(final String line) |
| 4247 | { |
no test coverage detected