src/java.xml/share/classes/com/sun/org/apache/xml/internal/resolver/CatalogException.java

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 // CatalogException.java - Catalog exception
   6 
   7 /*
   8  * Copyright 2001-2004 The Apache Software Foundation or its licensors,
   9  * as applicable.
  10  *
  11  * Licensed under the Apache License, Version 2.0 (the "License");
  12  * you may not use this file except in compliance with the License.
  13  * You may obtain a copy of the License at
  14  *
  15  *      http://www.apache.org/licenses/LICENSE-2.0
  16  *
  17  * Unless required by applicable law or agreed to in writing, software
  18  * distributed under the License is distributed on an "AS IS" BASIS,
  19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20  * See the License for the specific language governing permissions and
  21  * limitations under the License.
  22  */
  23 
  24 package com.sun.org.apache.xml.internal.resolver;
  25 
  26 /**
  27  * Signal Catalog exception.
  28  *
  29  * <p>This exception is thrown if an error occurs loading a
  30  * catalog file.</p>
  31  *
  32  * @see Catalog
  33  *
  34  * @author Norman Walsh
  35  * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
  36  *
  37  */
  38 public class CatalogException extends Exception {



  39   /** A wrapper around another exception */
  40   public static final int WRAPPER = 1;
  41   /** An invalid entry */
  42   public static final int INVALID_ENTRY = 2;
  43   /** An invalid entry type */
  44   public static final int INVALID_ENTRY_TYPE = 3;
  45   /** Could not instantiate an XML parser */
  46   public static final int NO_XML_PARSER = 4;
  47   /** Unknown XML format */
  48   public static final int UNKNOWN_FORMAT = 5;
  49   /** Unparseable XML catalog (not XML)*/
  50   public static final int UNPARSEABLE = 6;
  51   /** XML but parse failed */
  52   public static final int PARSE_FAILED = 7;
  53   /** Text catalog ended in mid-comment */
  54   public static final int UNENDED_COMMENT = 8;
  55 
  56   /**
  57    * The embedded exception if tunnelling, or null.
  58    */
  59   private Exception exception = null;
  60   private int exceptionType = 0;
  61 
  62   /**
  63    * Create a new CatalogException.
  64    *
  65    * @param type The exception type
  66    * @param message The error or warning message.
  67    */
  68   public CatalogException (int type, String message) {
  69     super(message);
  70     this.exceptionType = type;
  71     this.exception = null;
  72   }
  73 
  74   /**
  75    * Create a new CatalogException.
  76    *
  77    * @param type The exception type
  78    */
  79   public CatalogException (int type) {
  80     super("Catalog Exception " + type);


   1 /*
   2  * Licensed to the Apache Software Foundation (ASF) under one or more
   3  * contributor license agreements.  See the NOTICE file distributed with
   4  * this work for additional information regarding copyright ownership.
   5  * The ASF licenses this file to You under the Apache License, Version 2.0
   6  * (the "License"); you may not use this file except in compliance with
   7  * the License.  You may obtain a copy of the License at


   8  *




   9  *      http://www.apache.org/licenses/LICENSE-2.0
  10  *
  11  * Unless required by applicable law or agreed to in writing, software
  12  * distributed under the License is distributed on an "AS IS" BASIS,
  13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14  * See the License for the specific language governing permissions and
  15  * limitations under the License.
  16  */
  17 
  18 package com.sun.org.apache.xml.internal.resolver;
  19 
  20 /**
  21  * Signal Catalog exception.
  22  *
  23  * <p>This exception is thrown if an error occurs loading a
  24  * catalog file.</p>
  25  *
  26  * @see Catalog
  27  *
  28  * @author Norman Walsh
  29  * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
  30  *
  31  */
  32 public class CatalogException extends Exception {
  33 
  34   private static final long serialVersionUID = 4007157171817798450L;
  35 
  36   /** A wrapper around another exception */
  37   public static final int WRAPPER = 1;
  38   /** An invalid entry */
  39   public static final int INVALID_ENTRY = 2;
  40   /** An invalid entry type */
  41   public static final int INVALID_ENTRY_TYPE = 3;
  42   /** Could not instantiate an XML parser */
  43   public static final int NO_XML_PARSER = 4;
  44   /** Unknown XML format */
  45   public static final int UNKNOWN_FORMAT = 5;
  46   /** Unparseable XML catalog (not XML)*/
  47   public static final int UNPARSEABLE = 6;
  48   /** XML but parse failed */
  49   public static final int PARSE_FAILED = 7;
  50   /** Text catalog ended in mid-comment */
  51   public static final int UNENDED_COMMENT = 8;
  52 
  53   /**
  54    * The embedded exception if tunnelling, or null.
  55    */
  56   private final Exception exception;
  57   private final int exceptionType;
  58 
  59   /**
  60    * Create a new CatalogException.
  61    *
  62    * @param type The exception type
  63    * @param message The error or warning message.
  64    */
  65   public CatalogException (int type, String message) {
  66     super(message);
  67     this.exceptionType = type;
  68     this.exception = null;
  69   }
  70 
  71   /**
  72    * Create a new CatalogException.
  73    *
  74    * @param type The exception type
  75    */
  76   public CatalogException (int type) {
  77     super("Catalog Exception " + type);