Package com.netcetera.girders.i18n
Class MessageSourceDecorator
java.lang.Object
com.netcetera.girders.i18n.MessageSourceDecorator
- All Implemented Interfaces:
org.springframework.context.MessageSource
@ManagedResource(objectName="com.netcetera.girders:name=messageSource,type=MessageSourceDecorator")
public final class MessageSourceDecorator
extends Object
implements org.springframework.context.MessageSource
Decorator for a
MessageSource
that provides additional functionality for debugging and profiling text
resources.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(String code, Object[] args, String defaultMessage, Locale locale) getMessage
(String code, Object[] args, Locale locale) getMessage
(org.springframework.context.MessageSourceResolvable resolvable, Locale locale) boolean
void
setAppendCode
(boolean appendCode) Set the decorator to append the message code to the resolved message.
-
Constructor Details
-
MessageSourceDecorator
public MessageSourceDecorator()
-
-
Method Details
-
isAppendCode
@ManagedAttribute public boolean isAppendCode()- Returns:
true
if the decorator is configured to append the code to the resolved message.
-
setAppendCode
@ManagedAttribute public void setAppendCode(boolean appendCode) Set the decorator to append the message code to the resolved message.- Parameters:
appendCode
-true
to activate andfalse
to deactivate.
-
getMessage
public String getMessage(@NonNull String code, @Nullable Object[] args, @Nullable String defaultMessage, @NonNull Locale locale) - Specified by:
getMessage
in interfaceorg.springframework.context.MessageSource
-
getMessage
public String getMessage(@NonNull String code, @Nullable Object[] args, @NonNull Locale locale) throws org.springframework.context.NoSuchMessageException - Specified by:
getMessage
in interfaceorg.springframework.context.MessageSource
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(@NonNull org.springframework.context.MessageSourceResolvable resolvable, @NonNull Locale locale) throws org.springframework.context.NoSuchMessageException - Specified by:
getMessage
in interfaceorg.springframework.context.MessageSource
- Throws:
org.springframework.context.NoSuchMessageException
-