com.sdm.quasar.client.core.common.util
Interface NamedException

All Known Implementing Classes:
AbstractNamedCheckedException, AbstractNamedRuntimeException

public interface NamedException

A simple interface for exceptions that support different error cases (described by id's), exception type (severity) and support localization.

Version:
1.$Revision: 1.1 $
Author:
Thomas Wolf

Field Summary
static int EXCEPTION_TYPE_EXCEPTION
          Exception-Type: normal exception.
static int EXCEPTION_TYPE_INFO
          Exception-Type: info.
static int EXCEPTION_TYPE_WARNING
          Exception-Type: warning.
 
Method Summary
 java.util.Map getArgs()
          Returns all arguments of the exception.
 java.lang.String getID()
          Returns the exception identifier of the exception (never null).
 java.lang.String getName()
          Returns the full name of this exception (never null).
 int getType()
          Returns the exception type.
 java.lang.String getUnlocalizedMessagePattern(java.lang.String id)
          Returns an unlocalized exception message pattern.
 

Field Detail

EXCEPTION_TYPE_EXCEPTION

public static final int EXCEPTION_TYPE_EXCEPTION
Exception-Type: normal exception.

See Also:
Constant Field Values

EXCEPTION_TYPE_WARNING

public static final int EXCEPTION_TYPE_WARNING
Exception-Type: warning.

See Also:
Constant Field Values

EXCEPTION_TYPE_INFO

public static final int EXCEPTION_TYPE_INFO
Exception-Type: info.

See Also:
Constant Field Values
Method Detail

getID

public java.lang.String getID()
Returns the exception identifier of the exception (never null). The exception identifier is a string that differs between various instances of the same exception class.


getName

public java.lang.String getName()
Returns the full name of this exception (never null). The name should be unique for all implementations (??instances??) of NamedException. The first part should be the class name (without package name) followed by a dot (".") and the exception name. This name will be used to localize the exception.


getType

public int getType()
Returns the exception type. The exception type might be at least one of EXCEPTION_TYPE_EXCEPTION, EXCEPTION_TYPE_WARNING or EXCEPTION_TYPE_INFO.

Returns:
the exception type.

getArgs

public java.util.Map getArgs()
Returns all arguments of the exception. The keys of the arguments have to be strings in order to use them to format error messages. The argument map might be used to format a (localized) error message.

Returns:
the argument map for the error (never null).

getUnlocalizedMessagePattern

public java.lang.String getUnlocalizedMessagePattern(java.lang.String id)
Returns an unlocalized exception message pattern. This will be used, if no localization of this exception can be done.

Parameters:
id - the exception identifier (see getID()())
Returns:
the unlocalized exception message pattern.