fr.cnes.sirius.patrius.tools.exception.util
Enum ToolsMessages

java.lang.Object
  extended by java.lang.Enum<ToolsMessages>
      extended by fr.cnes.sirius.patrius.tools.exception.util.ToolsMessages
All Implemented Interfaces:
Serializable, Comparable<ToolsMessages>, Localizable

public enum ToolsMessages
extends Enum<ToolsMessages>
implements Localizable, Serializable

Enumeration for localized messages formats used in exceptions messages.

This class is roughly the same as the one in OREKIT. It adds Patrius tools messages in the same manner as OREKIT does. Users should see OREKIT documentation about localized messages format.

Since:
1.0
Version:
$Id: ToolsMessages.java 6357 2012-09-24 09:03:54Z CardosoP $
Author:
Philippe Pavero
Use sample :
...
PatriusMessages myMessage = PatriusMessages.PDB_MY_MESSAGE;
System.out.println(myMessage.getLocalizedString(Locale.FRENCH));
...
Concurrency :
immutable

Enum Constant Summary
CORRUPTED_FILE
          CORRUPTED_FILE.
INCOHERENT_ARGUMENTS
          INCOHERENT_ARGUMENTS.
INCOHERENT_PROPERTIES
          INCOHERENT_PROPERTIES.
INVALID_XML
          INVALID_XML.
MISSING_INITIAL_STATE
          MISSING_INITIAL_STATE.
MISSING_NUMERICAL_INTEGRATOR
          MISSING_NUMERICAL_INTEGRATOR.
MISSING_PROPAGATION_INTERVAL
          MISSING_PROPAGATION_INTERVAL.
MISSING_STEP_HANDLER
          MISSING STEP HANDLER.
NULL_ARGUMENT
          NULL_ARGUMENT.
OUT_OF_RANGE_ARGUMENT
          OUT_OF_RANGE_ARGUMENT.
UNABLE_TO_FIND_FILE
          UNABLE_TO_FIND_FILE.
UNABLE_TO_PARSE_URI
          UNABLE_TO_PARSE_URI.
 
Method Summary
 String getLocalizedString(Locale locale)
          Gets the localized string.
 String getSourceString()
          Gets the source (non-localized) string.
static ToolsMessages valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ToolsMessages[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CORRUPTED_FILE

public static final ToolsMessages CORRUPTED_FILE
CORRUPTED_FILE.


INCOHERENT_ARGUMENTS

public static final ToolsMessages INCOHERENT_ARGUMENTS
INCOHERENT_ARGUMENTS.


INCOHERENT_PROPERTIES

public static final ToolsMessages INCOHERENT_PROPERTIES
INCOHERENT_PROPERTIES.


NULL_ARGUMENT

public static final ToolsMessages NULL_ARGUMENT
NULL_ARGUMENT.


OUT_OF_RANGE_ARGUMENT

public static final ToolsMessages OUT_OF_RANGE_ARGUMENT
OUT_OF_RANGE_ARGUMENT.


UNABLE_TO_FIND_FILE

public static final ToolsMessages UNABLE_TO_FIND_FILE
UNABLE_TO_FIND_FILE.


UNABLE_TO_PARSE_URI

public static final ToolsMessages UNABLE_TO_PARSE_URI
UNABLE_TO_PARSE_URI.


MISSING_INITIAL_STATE

public static final ToolsMessages MISSING_INITIAL_STATE
MISSING_INITIAL_STATE.


MISSING_PROPAGATION_INTERVAL

public static final ToolsMessages MISSING_PROPAGATION_INTERVAL
MISSING_PROPAGATION_INTERVAL.


MISSING_NUMERICAL_INTEGRATOR

public static final ToolsMessages MISSING_NUMERICAL_INTEGRATOR
MISSING_NUMERICAL_INTEGRATOR.


INVALID_XML

public static final ToolsMessages INVALID_XML
INVALID_XML.


MISSING_STEP_HANDLER

public static final ToolsMessages MISSING_STEP_HANDLER
MISSING STEP HANDLER.

Method Detail

values

public static ToolsMessages[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ToolsMessages c : ToolsMessages.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ToolsMessages valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getSourceString

public String getSourceString()
Gets the source (non-localized) string.

Specified by:
getSourceString in interface Localizable
Returns:
the source string.

getLocalizedString

public String getLocalizedString(Locale locale)
Gets the localized string.

Specified by:
getLocalizedString in interface Localizable
Parameters:
locale - locale into which to get the string.
Returns:
the localized string or the source string if no localized version is available.


Copyright © 2016 CNES. All Rights Reserved.