net.sf.mmm.util.nls.api
Class NlsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.sf.mmm.util.nls.api.AbstractNlsException
              extended by net.sf.mmm.util.nls.api.NlsException
All Implemented Interfaces:
Serializable, NlsObject, NlsThrowable

public abstract class NlsException
extends AbstractNlsException

This is an abstract base implementation of a checked exception with real native language support (NLS).
ATTENTION:
Checked exceptions should be used for business errors and should only occur in unexpected situations.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
NlsThrowable, Serialized Form

Field Summary
private static long serialVersionUID
          UID for serialization.
 
Fields inherited from interface net.sf.mmm.util.nls.api.NlsObject
KEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_FILE, KEY_FUNCTION, KEY_ID, KEY_KEY, KEY_LOCATION, KEY_MAX, KEY_MIN, KEY_MODE, KEY_NAME, KEY_OBJECT, KEY_OPERAND, KEY_OPERATION, KEY_OPTION, KEY_PATH, KEY_PROPERTY, KEY_QUERY, KEY_RESOURCE, KEY_SIZE, KEY_SOURCE, KEY_TARGET_TYPE, KEY_TITLE, KEY_TYPE, KEY_URI, KEY_VALUE
 
Constructor Summary
NlsException(NlsMessage message)
          The constructor.
NlsException(String internationalizedMessage, Map<String,Object> arguments)
          The constructor.
NlsException(String internationalizedMessage, Object... arguments)
          Deprecated. use NlsException(String, Map) instead.
NlsException(Throwable nested, NlsMessage message)
          The constructor.
NlsException(Throwable nested, String internationalizedMessage, Map<String,Object> arguments)
          The constructor.
NlsException(Throwable nested, String internationalizedMessage, Object... arguments)
          Deprecated. use NlsException(String, Map) instead.
 
Method Summary
protected static Map<String,Object> addToMap(Map<String,Object> map, String key, Object value)
          This method adds the given arguments to the given Map.
protected static Map<String,Object> toMap(String key1, Object value1)
          This method create a Map for the given arguments.
protected static Map<String,Object> toMap(String key1, Object value1, String key2, Object value2)
          This method create a Map for the given arguments.
protected static Map<String,Object> toMap(String key1, Object value1, String key2, Object value2, String key3, Object value3)
          This method create a Map for the given arguments.
 
Methods inherited from class net.sf.mmm.util.nls.api.AbstractNlsException
createUuid, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, getNlsMessage, getUuid, printStackTrace, printStackTrace, printStackTrace, printStackTrace, printStackTrace, toNlsMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.nls.api.NlsThrowable
getCause, getStackTrace
 

Field Detail

serialVersionUID

private static final long serialVersionUID
UID for serialization.

See Also:
Constant Field Values
Constructor Detail

NlsException

@Deprecated
public NlsException(String internationalizedMessage,
                               Object... arguments)
Deprecated. use NlsException(String, Map) instead.

The constructor.

Parameters:
internationalizedMessage - is a short description of the problem. It is used for internationalization and should be in English language.
arguments - are the arguments filled into the internaitionalizedMessage after nationalization. May be empty if no variable arguments exist.

NlsException

@Deprecated
public NlsException(Throwable nested,
                               String internationalizedMessage,
                               Object... arguments)
Deprecated. use NlsException(String, Map) instead.

The constructor.

Parameters:
nested - is the cause of this exception.
internationalizedMessage - is a short description of the problem. It is used for internationalization and should be in English language.
arguments - are the arguments filled into the internaitionalizedMessage after nationalization. May be empty if no variable arguments exist.

NlsException

public NlsException(String internationalizedMessage,
                    Map<String,Object> arguments)
The constructor.

Parameters:
internationalizedMessage - is a short description of the problem. It is used for internationalization and should be in English language.
arguments - are the arguments to be filled into internationalizedMessage.

NlsException

public NlsException(Throwable nested,
                    String internationalizedMessage,
                    Map<String,Object> arguments)
The constructor.

Parameters:
nested - is the cause of this exception.
internationalizedMessage - is a short description of the problem. It is used for internationalization and should be in English language.
arguments - are the arguments to be filled into internationalizedMessage.
See Also:
toMap(String, Object, String, Object)

NlsException

public NlsException(NlsMessage message)
The constructor.

Parameters:
message - the message describing the problem briefly.

NlsException

public NlsException(Throwable nested,
                    NlsMessage message)
The constructor.

Parameters:
nested - is the cause of this exception.
message - the message describing the problem briefly.
Method Detail

addToMap

protected static Map<String,Object> addToMap(Map<String,Object> map,
                                             String key,
                                             Object value)
This method adds the given arguments to the given Map.

Parameters:
map - is the Map to use or null to create a new Map.
key - is the key of the entry to add.
value - is the value of the entry to add.
Returns:
a the given map (or a new one if map was null) after the given entry was added.

toMap

protected static Map<String,Object> toMap(String key1,
                                          Object value1)
This method create a Map for the given arguments.

Parameters:
key1 - is the key of the first map entry.
value1 - is the value of the first map entry.
Returns:
a Map containing only the given arguments.

toMap

protected static Map<String,Object> toMap(String key1,
                                          Object value1,
                                          String key2,
                                          Object value2)
This method create a Map for the given arguments.

Parameters:
key1 - is the key of the first map entry.
value1 - is the value of the first map entry.
key2 - is the key of the second map entry.
value2 - is the value of the second map entry.
Returns:
a Map containing only the given arguments.

toMap

protected static Map<String,Object> toMap(String key1,
                                          Object value1,
                                          String key2,
                                          Object value2,
                                          String key3,
                                          Object value3)
This method create a Map for the given arguments.

Parameters:
key1 - is the key of the first map entry.
value1 - is the value of the first map entry.
key2 - is the key of the second map entry.
value2 - is the value of the second map entry.
key3 - is the key of the third map entry.
value3 - is the value of the third map entry.
Returns:
a Map containing only the given arguments.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.