Interface MessageResolver


public interface MessageResolver
A simplified variant of MessageSourceAccessor to allow more direct replacement with a no-op implementation in case the target MessageSource is unavailable to avoid resolution overhead.
Author:
Oliver Drotbohm
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MessageResolver
     
  • Method Summary

    Modifier and Type
    Method
    Description
    of(@Nullable org.springframework.context.MessageSource messageSource)
    Obtains a MessageResolver for the given MessageSource.
    @Nullable String
    resolve(org.springframework.context.MessageSourceResolvable resolvable)
    Resolve the given MessageSourceResolvable.
  • Field Details

  • Method Details

    • resolve

      @Nullable String resolve(org.springframework.context.MessageSourceResolvable resolvable)
      Resolve the given MessageSourceResolvable. Return null if no message was found.
      Parameters:
      resolvable - must not be null.
      Returns:
    • of

      static MessageResolver of(@Nullable org.springframework.context.MessageSource messageSource)
      Obtains a MessageResolver for the given MessageSource.
      Parameters:
      messageSource - can be null.
      Returns:
      will never be null.