org.apache.xml.resolver

Class CatalogException


public class CatalogException
extends Exception

Signal Catalog exception.

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

Version:
1.0
Author:
Norman Walsh Norman.Walsh@Sun.COM
See Also:
Catalog

Field Summary

static int
INVALID_ENTRY
An invalid entry
static int
INVALID_ENTRY_TYPE
An invalid entry type
static int
NO_XML_PARSER
Could not instantiate an XML parser
static int
PARSE_FAILED
XML but parse failed
static int
UNENDED_COMMENT
Text catalog ended in mid-comment
static int
UNKNOWN_FORMAT
Unknown XML format
static int
UNPARSEABLE
Unparseable XML catalog (not XML)
static int
WRAPPER
A wrapper around another exception

Constructor Summary

CatalogException(Exception e)
Create a new CatalogException wrapping an existing exception.
CatalogException(String message, Exception e)
Create a new CatalogException from an existing exception.
CatalogException(int type)
Create a new CatalogException.
CatalogException(int type, String message)
Create a new CatalogException.

Method Summary

Exception
getException()
Return the embedded exception, if any.
int
getExceptionType()
Return the exception type
String
getMessage()
Return a detail message for this exception.
String
toString()
Override toString to pick up any embedded exception.

Field Details

INVALID_ENTRY

public static final int INVALID_ENTRY
An invalid entry
Field Value:
2

INVALID_ENTRY_TYPE

public static final int INVALID_ENTRY_TYPE
An invalid entry type
Field Value:
3

NO_XML_PARSER

public static final int NO_XML_PARSER
Could not instantiate an XML parser
Field Value:
4

PARSE_FAILED

public static final int PARSE_FAILED
XML but parse failed
Field Value:
7

UNENDED_COMMENT

public static final int UNENDED_COMMENT
Text catalog ended in mid-comment
Field Value:
8

UNKNOWN_FORMAT

public static final int UNKNOWN_FORMAT
Unknown XML format
Field Value:
5

UNPARSEABLE

public static final int UNPARSEABLE
Unparseable XML catalog (not XML)
Field Value:
6

WRAPPER

public static final int WRAPPER
A wrapper around another exception
Field Value:
1

Constructor Details

CatalogException

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.

Parameters:
e - The exception to be wrapped in a CatalogException.

CatalogException

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.

Parameters:
message - The detail message.
e - The exception to be wrapped in a CatalogException.

CatalogException

public CatalogException(int type)
Create a new CatalogException.
Parameters:
type - The exception type

CatalogException

public CatalogException(int type,
                        String message)
Create a new CatalogException.
Parameters:
type - The exception type
message - The error or warning message.

Method Details

getException

public Exception getException()
Return the embedded exception, if any.
Returns:
The embedded exception, or null if there is none.

getExceptionType

public int getExceptionType()
Return the exception type
Returns:
The exception type

getMessage

public String getMessage()
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.

Returns:
The error or warning message.

toString

public String toString()
Override toString to pick up any embedded exception.
Returns:
A string representation of this exception.

Copyright B) 2001-2003 Apache Software Foundation. All Rights Reserved.