Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.util
Class LucidException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.crosswire.common.util.LucidException

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  BookException, ConfigException, FilterException, InstallException, NoSuchKeyException, StartupException

    public class LucidException

extends Exception

A LucidException adds 2 concepts to a base Exception, that of a wrapped Exception, that of internationalised (i18n) messages.

The first addition is the concept of an optional wrapped Exception (actually a Throwable), which describes what caused this to happen. Any well defined interface will define the exact exceptions that the methods of that interface will throw, and not leave it to the ambiguous "throws Exception". However the interface should have no idea how it will be implemented and so the details of exactly what broke under the covers gets lost. With LucidException this detail is kept in the wrapped Exception. This functionallity has been added to the base Exception class in J2SE 1.4

The second addition is the concept of i18n messages. Normal Exceptions are created with an almost random string in the message field, LucidExceptions define this string to be a key into a resource bundle, and to help formatting this string there is an optional Object array of format options. There is a constructor that allows us to specify no i18n lookup, which is useful if this lookup may have been done already.

Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors.

Version:
  $Id: LucidException.java,v 1.7 2005/03/09 02:25:57 dmsmith Exp $
Author:
  Joe Walker [joe at eireneh dot com]
See Also:
  `Licence`, `LucidRuntimeException`, Serialized Form

Field Summary
`private boolean` | `deprecated` Is the message to be included literally (ie passed a string), or should we look it up as a resource (ie passed a MsgBase).
`private static Logger` | `log` The log stream
`protected Object[]` | `params` The array of parameters
`private static long` | `serialVersionUID` Serialization ID

Constructor Summary
`LucidException(MsgBase msg)` All LucidExceptions are constructed with references to resources in an i18n properties file.
`LucidException(MsgBase msg, Object[] params)` All LucidExceptions are constructed with references to resources in an i18n properties file.
`LucidException(MsgBase msg, Throwable cause)` All LucidExceptions are constructed with references to resources in an i18n properties file.
`LucidException(MsgBase msg, Throwable cause, Object[] params)` All LucidExceptions are constructed with references to resources in an i18n properties file.

Method Summary
`String` | `getDetailedMessage()` Accessor of the full detailed version of the string
`String` | `getMessage()` We only unravel the message when we need to to save time

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### log

    private static final Logger log

  The log stream

### serialVersionUID

    private static final long serialVersionUID

  Serialization ID

  See Also:
    Constant Field Values

### deprecated

    private final boolean deprecated

  Is the message to be included literally (ie passed a string), or should we look it up as a resource (ie passed a MsgBase).

### params

    protected final Object[] params

  The array of parameters

Constructor Detail

### LucidException

    public LucidException(MsgBase msg)

  All LucidExceptions are constructed with references to resources in an i18n properties file.

  Parameters:
    `msg` - The resource id to read

### LucidException

    public LucidException(MsgBase msg,
                          Throwable cause)

  All LucidExceptions are constructed with references to resources in an i18n properties file.

  Parameters:
    `msg` - The resource id to read

### LucidException

    public LucidException(MsgBase msg,
                          Object[] params)

  All LucidExceptions are constructed with references to resources in an i18n properties file. This version allows us to add parameters

  Parameters:
    `msg` - The resource id to read
    `params` - An array of parameters

### LucidException

    public LucidException(MsgBase msg,
                          Throwable cause,
                          Object[] params)

  All LucidExceptions are constructed with references to resources in an i18n properties file. This version allows us to add parameters

  Parameters:
    `msg` - The resource id to read
    `params` - An array of parameters

Method Detail

### getMessage

    public String getMessage()

  We only unravel the message when we need to to save time

  Overrides:
    `getMessage` in class `Throwable`
  Returns:
    The unraveled i18n string

### getDetailedMessage

    public String getDetailedMessage()

  Accessor of the full detailed version of the string

  Returns:
    The full unraveled i18n string

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ? 2003-2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD