Package jmri
Class NamedBean.BadSystemNameException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
jmri.NamedBean.BadNameException
jmri.NamedBean.BadSystemNameException
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- NamedBean
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an exception with no message to the user or for logging.BadSystemNameException(String logging, String display) Create a localized exception, suitable for display to the user.BadSystemNameException(Locale locale, String message, Object... subs) Create a localized exception, suitable for display to the user. -
Method Summary
Methods inherited from class jmri.NamedBean.BadNameException
getLocalizedMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BadSystemNameException
public BadSystemNameException()Create an exception with no message to the user or for logging. Use only when calling methods likely have alternate mechanism for allowing user to understand why exception was thrown. -
BadSystemNameException
Create a localized exception, suitable for display to the user. This takes the same arguments asBundle.getMessage(java.util.Locale, java.lang.String, java.lang.Object...)as it uses that method to create both the localized and loggable messages.Use
NamedBean.BadNameException.getLocalizedMessage()to display the message to the user, and useThrowable.getMessage()to record the message in logs.Note the message must be accessible by
Bundle.- Parameters:
locale- the locale to be usedmessage- bundle key to be translatedsubs- One or more objects to be inserted into the message
-
BadSystemNameException
Create a localized exception, suitable for display to the user. This takes the non-localized message followed by the localized message.Use
NamedBean.BadNameException.getLocalizedMessage()to display the message to the user, and useThrowable.getMessage()to record the message in logs.- Parameters:
logging- the English message for loggingdisplay- the localized message for display
-