FileDocCategorySizeDatePackage
CatalogException.javaAPI DocJava SE 6 API4362Tue Jun 10 00:22:58 BST 2008com.sun.org.apache.xml.internal.resolver

CatalogException

public class CatalogException extends Exception
Signal Catalog exception.

This exception is thrown if an error occurs loading a catalog file.

see
Catalog
author
Norman Walsh Norman.Walsh@Sun.COM
version
1.0

Fields Summary
public static final int
WRAPPER
A wrapper around another exception
public static final int
INVALID_ENTRY
An invalid entry
public static final int
INVALID_ENTRY_TYPE
An invalid entry type
public static final int
NO_XML_PARSER
Could not instantiate an XML parser
public static final int
UNKNOWN_FORMAT
Unknown XML format
public static final int
UNPARSEABLE
Unparseable XML catalog (not XML)
public static final int
PARSE_FAILED
XML but parse failed
public static final int
UNENDED_COMMENT
Text catalog ended in mid-comment
private Exception
exception
The embedded exception if tunnelling, or null.
private int
exceptionType
Constructors Summary
public CatalogException(int type, String message)
Create a new CatalogException.

param
type The exception type
param
message The error or warning message.


                     
        
    super(message);
    this.exceptionType = type;
    this.exception = null;
  
public CatalogException(int type)
Create a new CatalogException.

param
type The exception type

    super("Catalog Exception " + type);
    this.exceptionType = type;
    this.exception = null;
  
public CatalogException(Exception e)
Create a new CatalogException wrapping an existing exception.

The existing exception will be embedded in the new one, and its message will become the default message for the CatalogException.

param
e The exception to be wrapped in a CatalogException.

    super();
    this.exceptionType = WRAPPER;
    this.exception = e;
  
public CatalogException(String message, Exception e)
Create a new CatalogException from an existing exception.

The existing exception will be embedded in the new one, but the new exception will have its own message.

param
message The detail message.
param
e The exception to be wrapped in a CatalogException.

    super(message);
    this.exceptionType = WRAPPER;
    this.exception = e;
  
Methods Summary
public java.lang.ExceptiongetException()
Return the embedded exception, if any.

return
The embedded exception, or null if there is none.

    return exception;
  
public intgetExceptionType()
Return the exception type

return
The exception type

    return exceptionType;
  
public java.lang.StringgetMessage()
Return a detail message for this exception.

If there is an embedded exception, and if the CatalogException has no detail message of its own, this method will return the detail message from the embedded exception.

return
The error or warning message.

    String message = super.getMessage();

    if (message == null && exception != null) {
      return exception.getMessage();
    } else {
      return message;
    }
  
public java.lang.StringtoString()
Override toString to pick up any embedded exception.

return
A string representation of this exception.

    if (exception != null) {
      return exception.toString();
    } else {
      return super.toString();
    }