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 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 and false to deactivate.
    • getMessage

      public String getMessage(@NonNull String code, @Nullable Object[] args, @Nullable String defaultMessage, @NonNull Locale locale)
      Specified by:
      getMessage in interface org.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 interface org.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 interface org.springframework.context.MessageSource
      Throws:
      org.springframework.context.NoSuchMessageException