home *** CD-ROM | disk | FTP | other *** search
- package netscape.palomar.sgml;
-
- import netscape.palomar.util.CascadedException;
-
- public class SGMLException extends CascadedException {
- public static final int INITIALIZE_PARSER = 200;
- public static final int PARSE_FILE = 201;
- public static final int WRITE_FILE = 202;
- public static final int GENERATE_TOKEN = 203;
- public static final int GENERATE_TEXT = 204;
- public static final int GET_LINE_FROM_STREAM = 205;
- public static final int READ_COMMENT = 206;
- public static final int NOT_TAG = 207;
- public static final int READ_TAG = 208;
- public static final int NOT_TEXT = 209;
- public static final int READ_TEXT = 210;
- public static final int PARSE_TIL_END_TAG = 211;
- public static final int PARSER_CLOSE = 212;
- public static final int COMMON_ANCESTOR = 213;
- public static final int PAGE_ELEMENT_WRITE = 214;
- public static final int RECON_LINE_IMAGE = 215;
- public static final int GET_ATTRIBUTE = 216;
- public static final int SET_ATTRIBUTE = 217;
- public static final int PARSING_ATTRIBUTES = 218;
- public static final int INIT_ATTRIBUTE = 219;
- public static final int UNQUOTE = 220;
- public static final int NOT_INITIALIZED = 221;
- public static final int PARSE_CHILDREN = 222;
- public static final int INSERT_TOKEN_TYPE = 223;
- public static final int INSERT_CONTEXT = 224;
- public static final int TAG_WRITE = 225;
- public static final int BEEN_CLONED = 226;
- public static final int FINISH_PROCESSING = 227;
-
- public SGMLException(int id) {
- super(id);
- }
-
- public SGMLException(int id, Exception e) {
- super(id, e);
- }
-
- protected String lookup(int id) {
- switch (id) {
- case 200:
- return "Failure while initializing the parse tables";
- case 201:
- return "Failure while parsing file $filename";
- case 202:
- return "Failure while writing out file $filename";
- case 203:
- return "Failure while trying to generate object for tag type $tag";
- case 204:
- return "Parser can not create SGMLText class.";
- case 205:
- return "Parser unable to read a line from the input stream, line $line";
- case 206:
- return "Parser unable to read a comment tag from the input stream, line $line";
- case 207:
- return "Request to read Tag when Text is expected next";
- case 208:
- return "Parser unable to read a tag from the input stream, line $line";
- case 209:
- return "Request to read Text when Tag is expected next";
- case 210:
- return "Parser unable to read text run from the input stream, line $line";
- case 211:
- return "Parser unable to find approriate end tag for $tag";
- case 212:
- return "Failure while trying to close SGML parser";
- case 213:
- return "Unable to find ancestor in common between $tag1 and $tag2, which usually indicates that they are not part of the same tree.";
- case 214:
- return "Error while attempting to write out page.";
- case 215:
- return "Unable to reconstruct the line image from the attributes";
- case 216:
- return "Unable to retrieve the attribute $attr from tag $tag";
- case 217:
- return "Unable to set the attribute $attr from tag $tag";
- case 218:
- return "Failure parsing attributes out of line image for tag $tag.";
- case 219:
- return "Unable to initialize attribute $attr value on tag $tag";
- case 220:
- return "failure unquoting a value for an attribute";
- case 221:
- return "Parse Failure, $item is not initialized correctly";
- case 222:
- return "Failure while parsing the children of $tag";
- case 223:
- return "Illegal to add child $tag to parent $parent";
- case 224:
- return "Context will not allow parent $parent to have child $child";
- case 225:
- return "Unable to write out SGML tag element";
- case 226:
- return "failure while performing deep";
- case 227:
- return "Error finishing processing of $tag tag on line $line, column $col";
- default:
- return "identifer " + id + " not in lookup table!";
- }
- }
- }
-