Package org.dspace.app.rest.exception
Interface TranslatableException
-
- All Known Implementing Classes:
EPersonNameNotProvidedException,GroupNameNotProvidedException,RESTEmptyWorkflowGroupException
public interface TranslatableExceptionImplement TranslatableException to make Exceptions or RuntimeExceptions translatable.
In most cases, only
getMessageKey()should be implemented;getMessage()andgetLocalizedMessage()are already provided byThrowableand the default implementation ofgetLocalizedMessage(Context)is usually sufficient.A locale-aware message can be obtained by calling
getLocalizedMessage(Context).- Author:
- Bruno Roemers (bruno.roemers at atmire.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetLocalizedMessage()Already implemented byThrowable.default StringgetLocalizedMessage(org.dspace.core.Context context)StringgetMessage()Already implemented byThrowable.StringgetMessageKey()
-
-
-
Method Detail
-
getMessageKey
String getMessageKey()
- Returns:
- message key (used for lookup with
I18nUtil)
-
getMessage
String getMessage()
Already implemented byThrowable.- Returns:
- message for default locale
-
getLocalizedMessage
String getLocalizedMessage()
Already implemented byThrowable.- Returns:
- message for default locale
-
getLocalizedMessage
default String getLocalizedMessage(org.dspace.core.Context context)
- Parameters:
context- current DSpace context (used to infer current locale)- Returns:
- message for current locale (or default locale if current locale did not yield a result)
-
-