org.orekit.errors
Class OrekitException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.orekit.errors.OrekitException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FrameAncestorException, PropagationException

public class OrekitException
extends java.lang.Exception

This class is the base class for all specific exceptions thrown by the orekit classes.

When the orekit classes throw exceptions that are specific to the package, these exceptions are always subclasses of OrekitException. When exceptions that are already covered by the standard java API should be thrown, like ArrayIndexOutOfBoundsException or InvalidParameterException, these standard exceptions are thrown rather than the commons-math specific ones.

This class also provides utility methods to throw some standard java exceptions with localized messages.

Version:
$Revision:1665 $ $Date:2008-06-11 12:12:59 +0200 (mer., 11 juin 2008) $
Author:
Luc Maisonobe
See Also:
Serialized Form

Constructor Summary
OrekitException(java.lang.String specifier, java.lang.Object... parts)
          Simple constructor.
OrekitException(java.lang.String message, java.lang.Throwable cause)
          Simple constructor.
OrekitException(java.lang.Throwable cause, java.lang.String specifier, java.lang.Object... parts)
          Simple constructor.
 
Method Summary
static java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.String specifier, java.lang.Object... parts)
          Create an IllegalArgumentException with localized message.
static java.lang.IllegalStateException createIllegalStateException(java.lang.String specifier, java.lang.Object... parts)
          Create an IllegalStateException with localized message.
static java.lang.RuntimeException createInternalError(java.lang.Throwable cause)
          Create an RuntimeException for an internal error.
static java.text.ParseException createParseException(java.lang.String specifier, java.lang.Object... parts)
          Create an ParseException with localized message.
 java.lang.String getLocalizedMessage()
          
 java.lang.String getMessage()
          
 java.lang.String getMessage(java.util.Locale locale)
          Gets the message in a specified locale.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrekitException

public OrekitException(java.lang.String specifier,
                       java.lang.Object... parts)
Simple constructor. Build an exception with a translated and formatted message

Parameters:
specifier - format specifier (to be translated)
parts - parts to insert in the format (no translation)

OrekitException

public OrekitException(java.lang.String message,
                       java.lang.Throwable cause)
Simple constructor. Build an exception from a cause and with a specified message

Parameters:
message - descriptive message
cause - underlying cause

OrekitException

public OrekitException(java.lang.Throwable cause,
                       java.lang.String specifier,
                       java.lang.Object... parts)
Simple constructor. Build an exception from a cause and with a translated and formatted message

Parameters:
cause - underlying cause
specifier - format specifier (to be translated)
parts - parts to insert in the format (no translation)
Method Detail

getMessage

public java.lang.String getMessage(java.util.Locale locale)
Gets the message in a specified locale.

Parameters:
locale - Locale in which the message should be translated
Returns:
localized message
Since:
5.0

getMessage

public java.lang.String getMessage()

Overrides:
getMessage in class java.lang.Throwable

getLocalizedMessage

public java.lang.String getLocalizedMessage()

Overrides:
getLocalizedMessage in class java.lang.Throwable

createIllegalArgumentException

public static java.lang.IllegalArgumentException createIllegalArgumentException(java.lang.String specifier,
                                                                                java.lang.Object... parts)
Create an IllegalArgumentException with localized message.

Parameters:
specifier - format specifier (to be translated)
parts - parts to insert in the format (no translation)
Returns:
an IllegalArgumentException with localized message

createIllegalStateException

public static java.lang.IllegalStateException createIllegalStateException(java.lang.String specifier,
                                                                          java.lang.Object... parts)
Create an IllegalStateException with localized message.

Parameters:
specifier - format specifier (to be translated)
parts - parts to insert in the format (no translation)
Returns:
an IllegalStateException with localized message

createParseException

public static java.text.ParseException createParseException(java.lang.String specifier,
                                                            java.lang.Object... parts)
Create an ParseException with localized message.

Parameters:
specifier - format specifier (to be translated)
parts - parts to insert in the format (no translation)
Returns:
an ParseException with localized message

createInternalError

public static java.lang.RuntimeException createInternalError(java.lang.Throwable cause)
Create an RuntimeException for an internal error.

Parameters:
cause - underlying cause
Returns:
an RuntimeException for an internal error


Copyright © 2002-2010 CS Communication & Systèmes. All Rights Reserved.