home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / jserv / com / kav / xsl / XSLException.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-05-16  |  1.4 KB  |  28 lines

  1. package com.kav.xsl;
  2.  
  3. public class XSLException extends Exception {
  4.    public static final int INVALID_CHILD_NODE = 0;
  5.    public static final int INVALID_RULE = 1;
  6.    public static final int INVALID_MATCH_PATTERN = 2;
  7.    public static final int INVALID_SELECT_PATTERN = 3;
  8.    public static final int INVALID_XSL_ELEMENT = 4;
  9.    public static final int INVALID_ATTRIBUTE_VALUE_TEMPLATE = 5;
  10.    public static final int MISSING_REQUIRED_ATTR = 6;
  11.    public static String[] errorMessages = new String[]{"Invalid child node - ", "Invalid Rule - ", "Invalid Match Pattern - ", "Invalid Select Pattern - ", "Invalid XSL Element - ", "Invalid attribute value template - ", "Missing required attribute - "};
  12.    private int error = -1;
  13.    private static String prefix = "XSLException: ";
  14.  
  15.    public XSLException(String var1) {
  16.       super(var1);
  17.    }
  18.  
  19.    public XSLException(int var1, String var2) {
  20.       super(var2);
  21.       this.error = var1;
  22.    }
  23.  
  24.    public String getMessage() {
  25.       return this.error >= 0 && this.error < errorMessages.length ? prefix + errorMessages[this.error] + super.getMessage() : prefix + super.getMessage();
  26.    }
  27. }
  28.