Class CmsKeyDummyMacroResolver

  • All Implemented Interfaces:
    I_CmsMacroResolver

    public class CmsKeyDummyMacroResolver
    extends CmsMacroResolver
    Macro resolver used to temporarily replace localization message macros with random UUIDs and then replace the UUIDs with the original key after all other macro processing has happened.

    We need this because we want to preserve the message key, but evaluate macros they may be nested in.

    • Field Detail

      • PATTERN_MESSAGE

        public static final java.util.regex.Pattern PATTERN_MESSAGE
        Pattern to match message key macros.
    • Method Detail

      • getKey

        public static java.lang.String getKey​(java.lang.String s)
        Extracts the message from a string of the form %(key.{message}), or returns null if the input string does not have this form.
        Parameters:
        s - the input string
        Returns:
        the key the extracted message key
      • getKey

        public static java.lang.String getKey​(java.lang.String s,
                                              CmsMacroResolver delegate)
        Gets the localization key name of a (potentially nested) key macro in a base string.

        Parameters:
        s - the base string
        delegate - the macro resolver used to resolve macros which the key macro may be nested in
        Returns:
        the localization key