home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / netcast.z / ncjava10.jar / netscape / palomar / sgml / SGMLException.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  3.8 KB  |  106 lines

  1. package netscape.palomar.sgml;
  2.  
  3. import netscape.palomar.util.CascadedException;
  4.  
  5. public class SGMLException extends CascadedException {
  6.    public static final int INITIALIZE_PARSER = 200;
  7.    public static final int PARSE_FILE = 201;
  8.    public static final int WRITE_FILE = 202;
  9.    public static final int GENERATE_TOKEN = 203;
  10.    public static final int GENERATE_TEXT = 204;
  11.    public static final int GET_LINE_FROM_STREAM = 205;
  12.    public static final int READ_COMMENT = 206;
  13.    public static final int NOT_TAG = 207;
  14.    public static final int READ_TAG = 208;
  15.    public static final int NOT_TEXT = 209;
  16.    public static final int READ_TEXT = 210;
  17.    public static final int PARSE_TIL_END_TAG = 211;
  18.    public static final int PARSER_CLOSE = 212;
  19.    public static final int COMMON_ANCESTOR = 213;
  20.    public static final int PAGE_ELEMENT_WRITE = 214;
  21.    public static final int RECON_LINE_IMAGE = 215;
  22.    public static final int GET_ATTRIBUTE = 216;
  23.    public static final int SET_ATTRIBUTE = 217;
  24.    public static final int PARSING_ATTRIBUTES = 218;
  25.    public static final int INIT_ATTRIBUTE = 219;
  26.    public static final int UNQUOTE = 220;
  27.    public static final int NOT_INITIALIZED = 221;
  28.    public static final int PARSE_CHILDREN = 222;
  29.    public static final int INSERT_TOKEN_TYPE = 223;
  30.    public static final int INSERT_CONTEXT = 224;
  31.    public static final int TAG_WRITE = 225;
  32.    public static final int BEEN_CLONED = 226;
  33.    public static final int FINISH_PROCESSING = 227;
  34.  
  35.    public SGMLException(int id) {
  36.       super(id);
  37.    }
  38.  
  39.    public SGMLException(int id, Exception e) {
  40.       super(id, e);
  41.    }
  42.  
  43.    protected String lookup(int id) {
  44.       switch (id) {
  45.          case 200:
  46.             return "Failure while initializing the parse tables";
  47.          case 201:
  48.             return "Failure while parsing file $filename";
  49.          case 202:
  50.             return "Failure while writing out file $filename";
  51.          case 203:
  52.             return "Failure while trying to generate object for tag type $tag";
  53.          case 204:
  54.             return "Parser can not create SGMLText class.";
  55.          case 205:
  56.             return "Parser unable to read a line from the input stream, line $line";
  57.          case 206:
  58.             return "Parser unable to read a comment tag from the input stream, line $line";
  59.          case 207:
  60.             return "Request to read Tag when Text is expected next";
  61.          case 208:
  62.             return "Parser unable to read a tag from the input stream, line $line";
  63.          case 209:
  64.             return "Request to read Text when Tag is expected next";
  65.          case 210:
  66.             return "Parser unable to read text run from the input stream, line $line";
  67.          case 211:
  68.             return "Parser unable to find approriate end tag for $tag";
  69.          case 212:
  70.             return "Failure while trying to close SGML parser";
  71.          case 213:
  72.             return "Unable to find ancestor in common between $tag1 and $tag2, which usually indicates that they are not part of the same tree.";
  73.          case 214:
  74.             return "Error while attempting to write out page.";
  75.          case 215:
  76.             return "Unable to reconstruct the line image from the attributes";
  77.          case 216:
  78.             return "Unable to retrieve the attribute $attr from tag $tag";
  79.          case 217:
  80.             return "Unable to set the attribute $attr from tag $tag";
  81.          case 218:
  82.             return "Failure parsing attributes out of line image for tag $tag.";
  83.          case 219:
  84.             return "Unable to initialize attribute $attr value on tag $tag";
  85.          case 220:
  86.             return "failure unquoting a value for an attribute";
  87.          case 221:
  88.             return "Parse Failure, $item is not initialized correctly";
  89.          case 222:
  90.             return "Failure while parsing the children of $tag";
  91.          case 223:
  92.             return "Illegal to add child $tag to parent $parent";
  93.          case 224:
  94.             return "Context will not allow parent $parent to have child $child";
  95.          case 225:
  96.             return "Unable to write out SGML tag element";
  97.          case 226:
  98.             return "failure while performing deep";
  99.          case 227:
  100.             return "Error finishing processing of $tag tag on line $line, column $col";
  101.          default:
  102.             return "identifer " + id + " not in lookup table!";
  103.       }
  104.    }
  105. }
  106.