1 package com.tapina.robe.runtime;
2
3 import com.tapina.robe.swi.SWIDecoder;
4
5 /***
6 * Created by IntelliJ IDEA.
7 * User: gareth
8 * Date: Sep 4, 2003
9 * Time: 7:58:26 AM
10 */
11 public final class UnknownSWIException extends DecoderException {
12 private final int swiNumber;
13
14 public UnknownSWIException(int swiNumber) {
15 this.swiNumber = swiNumber;
16 }
17
18 public final String getMessage() {
19 StringBuffer message = new StringBuffer();
20 message.append("Unknown SWI &").append(Integer.toHexString(swiNumber));
21 try {
22 Class swiDecoder = SWIDecoder.getSwiHandler(swiNumber);
23 final String name = swiDecoder.getName();
24 message.append(" (").append(name.substring(name.lastIndexOf('.') + 1)).append(")");
25 } catch (NoSuchMethodException e) {
26
27 }
28 message.append(" at &" + Integer.toHexString(address));
29 return message.toString();
30 }
31 }