org.tigris.scarab.util
Class ScarabException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.apache.commons.lang.exception.NestableException
              extended byorg.apache.turbine.TurbineException
                  extended byorg.tigris.scarab.util.ScarabException
All Implemented Interfaces:
org.apache.commons.lang.exception.Nestable, java.io.Serializable
Direct Known Subclasses:
ComplexQueryException, DAException, IncompatibleMITListException, MaxConcurrentSearchException, ValidationException

public class ScarabException
extends org.apache.turbine.TurbineException

This class extends TurbineException and does not change its functionality. It should be used to mark Scarab specific exceptions. In order to ensure localization of Exception messages, ScarabException adds a new type of message, the L10NMessage.

Version:
$Id: ScarabException.java 10257 2006-08-07 22:43:30Z jorgeuriarte $
Author:
John D. McNally
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.commons.lang.exception.NestableException
delegate
 
Fields inherited from class java.lang.Exception
 
Constructor Summary
ScarabException(Localizable theL10nInstance)
          Constructs a new ScarabException with specified Localizable .
ScarabException(Localizable theL10nInstance, java.lang.Throwable nested)
          Constructs a new ScarabException with specified Localizable and a nested Throwable.
ScarabException(LocalizationKey theKey)
          Constructs a new ScarabException with specified resource and no parameters.
ScarabException(LocalizationKey theKey, java.lang.Object p1)
          convenience constructor: Constructs a new ScarabException with specified resource and one parameter.
ScarabException(LocalizationKey theKey, java.lang.Object[] theParams)
          Constructs a new ScarabException with specified resource and a list of parameters.
ScarabException(LocalizationKey theKey, java.lang.Object p1, java.lang.Object p2)
          convenience constructor: Constructs a new ScarabException with specified resource and two parameters.
ScarabException(LocalizationKey theKey, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          convenience constructor: Constructs a new ScarabException with specified resource and three parameters.
ScarabException(LocalizationKey theKey, java.lang.Throwable nested)
          Constructs a new ScarabException with specified resource and a nested Throwable.
ScarabException(LocalizationKey theKey, java.lang.Throwable nested, java.lang.Object p1)
          convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and one parameter.
ScarabException(LocalizationKey theKey, java.lang.Throwable nested, java.lang.Object[] theParams)
          convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and an aritrary set of parameters.
ScarabException(LocalizationKey theKey, java.lang.Throwable nested, java.lang.Object p1, java.lang.Object p2)
          convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and two parameters.
ScarabException(LocalizationKey theKey, java.lang.Throwable nested, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and three parameters.
 
Method Summary
 Localizable getL10nMessage()
          return the L10NInstance, or null, if no L10N key was given.
 java.lang.String getLocalizedMessage()
           
 java.lang.String getMessage()
          return the localized message in english.
 java.lang.String getMessage(ScarabLocalizationTool l10n)
          Deprecated. Does not follow core java patterns. Use setLocalizer(..) then getLocalizedMessage() instead.
 void setLocalizer(ScarabLocalizationTool localizer)
          Setter for property l10n.
 
Methods inherited from class org.apache.commons.lang.exception.NestableException
getCause, getMessage, getMessages, getThrowable, getThrowableCount, getThrowables, indexOfThrowable, indexOfThrowable, printPartialStackTrace, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScarabException

public ScarabException(LocalizationKey theKey)
Constructs a new ScarabException with specified resource and no parameters.

Parameters:
theKey - the l10n error key.

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Throwable nested)
Constructs a new ScarabException with specified resource and a nested Throwable.

Parameters:
theKey - the l10n error key.
nested -

ScarabException

public ScarabException(Localizable theL10nInstance)
Constructs a new ScarabException with specified Localizable .

Parameters:
theL10nInstance - the l10n error key.

ScarabException

public ScarabException(Localizable theL10nInstance,
                       java.lang.Throwable nested)
Constructs a new ScarabException with specified Localizable and a nested Throwable.

Parameters:
theL10nInstance - the l10n error key.
nested -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Object[] theParams)
Constructs a new ScarabException with specified resource and a list of parameters.

Parameters:
theParams -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Object p1)
convenience constructor: Constructs a new ScarabException with specified resource and one parameter.

Parameters:
p1 -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Object p1,
                       java.lang.Object p2)
convenience constructor: Constructs a new ScarabException with specified resource and two parameters.

Parameters:
p1 -
p2 -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Object p1,
                       java.lang.Object p2,
                       java.lang.Object p3)
convenience constructor: Constructs a new ScarabException with specified resource and three parameters.

Parameters:
p1 -
p2 -
p3 -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Throwable nested,
                       java.lang.Object[] theParams)
convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and an aritrary set of parameters.

Parameters:
theKey -
nested -
theParams -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Throwable nested,
                       java.lang.Object p1)
convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and one parameter.

Parameters:
theKey -
nested -
p1 -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Throwable nested,
                       java.lang.Object p1,
                       java.lang.Object p2)
convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and two parameters.

Parameters:
theKey -
nested -
p1 -
p2 -

ScarabException

public ScarabException(LocalizationKey theKey,
                       java.lang.Throwable nested,
                       java.lang.Object p1,
                       java.lang.Object p2,
                       java.lang.Object p3)
convenience constructor: Constructs a new ScarabException with specified resource, nested Throwable and three parameters.

Parameters:
theKey -
nested -
p1 -
p2 -
p3 -
Method Detail

getL10nMessage

public Localizable getL10nMessage()
return the L10NInstance, or null, if no L10N key was given.

Returns:

getMessage

public java.lang.String getMessage(ScarabLocalizationTool l10n)
Deprecated. Does not follow core java patterns. Use setLocalizer(..) then getLocalizedMessage() instead.

return the localized message by use of the given ScarabLocalizationTool. For further infos see getMessage

Parameters:
l10n -
Returns:

getMessage

public java.lang.String getMessage()
return the localized message in english. Note: It is preferrable to use getMessage Currently it is possible, that a ScarabException contains NO L10NInstance. This is due to the deprecated constructors ScarabException and ScarabException Eventually (after these constructors have been deleted from the code base) we guarantee, that ScarabException is fully localized.

Returns:
localized english text

setLocalizer

public void setLocalizer(ScarabLocalizationTool localizer)
Setter for property l10n.


getLocalizedMessage

public java.lang.String getLocalizedMessage()


Copyright © 2000-2004 Tigris.org. All Rights Reserved.