Class MathIllegalArgumentException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- org.apache.commons.math.exception.MathIllegalArgumentException
-
- All Implemented Interfaces:
java.io.Serializable
,MathThrowable
- Direct Known Subclasses:
MathIllegalNumberException
,NullArgumentException
public class MathIllegalArgumentException extends java.lang.IllegalArgumentException implements MathThrowable
Base class for all preconditions violation exceptions. This class is not intended to be instantiated directly: it should serve as a base class to create all the exceptions that share the semantics of the standardIllegalArgumentException
, but must also provide a localized message.- Since:
- 2.2
- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MathIllegalArgumentException(Localizable general, java.lang.Object... args)
protected
MathIllegalArgumentException(Localizable specific, Localizable general, java.lang.Object... args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]
getArguments()
Gets the arguments used to build the message of this throwable.Localizable
getGeneralPattern()
Gets the localizable pattern used to build the general part of the message of this throwable.java.lang.String
getLocalizedMessage()
Gets the message in the system default locale.java.lang.String
getMessage()
Gets the message in a conventional US locale.java.lang.String
getMessage(java.util.Locale locale)
Get the message in a specified locale.Localizable
getSpecificPattern()
Gets the localizable pattern used to build the specific part of the message of this throwable.
-
-
-
Constructor Detail
-
MathIllegalArgumentException
protected MathIllegalArgumentException(Localizable specific, Localizable general, java.lang.Object... args)
- Parameters:
specific
- Message pattern providing the specific context of the error.general
- Message pattern explaining the cause of the error.args
- Arguments.
-
MathIllegalArgumentException
protected MathIllegalArgumentException(Localizable general, java.lang.Object... args)
- Parameters:
general
- Message pattern explaining the cause of the error.args
- Arguments.
-
-
Method Detail
-
getSpecificPattern
public Localizable getSpecificPattern()
Gets the localizable pattern used to build the specific part of the message of this throwable.- Specified by:
getSpecificPattern
in interfaceMathThrowable
- Returns:
- localizable pattern used to build the specific part of the message of this throwable
-
getGeneralPattern
public Localizable getGeneralPattern()
Gets the localizable pattern used to build the general part of the message of this throwable.- Specified by:
getGeneralPattern
in interfaceMathThrowable
- Returns:
- localizable pattern used to build the general part of the message of this throwable
-
getArguments
public java.lang.Object[] getArguments()
Gets the arguments used to build the message of this throwable.- Specified by:
getArguments
in interfaceMathThrowable
- Returns:
- the arguments used to build the message of this throwable
-
getMessage
public java.lang.String getMessage(java.util.Locale locale)
Get the message in a specified locale.- Specified by:
getMessage
in interfaceMathThrowable
- Parameters:
locale
- Locale in which the message should be translated.- Returns:
- the localized message.
-
getMessage
public java.lang.String getMessage()
Gets the message in a conventional US locale.- Specified by:
getMessage
in interfaceMathThrowable
- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- localized message
-
getLocalizedMessage
public java.lang.String getLocalizedMessage()
Gets the message in the system default locale.- Specified by:
getLocalizedMessage
in interfaceMathThrowable
- Overrides:
getLocalizedMessage
in classjava.lang.Throwable
- Returns:
- localized message
-
-