Interface I_CmsMacroResolver

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char MACRO_DELIMITER
      Delimiter char '%' for a macro - new / current style.
      static char MACRO_DELIMITER_OLD
      Delimiter char '$' for a macro - old style.
      static char MACRO_END
      End char ')' for a macro - new / current style.
      static char MACRO_END_OLD
      End char '}' for a macro - old style.
      static char MACRO_START
      Start char '(' for a macro - new / current style.
      static char MACRO_START_OLD
      Start char '{' for a macro - old style.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getMacroValue​(java.lang.String macro)
      Resolves a single macro to the macro value, returns null if the macro could not be resolved.
      boolean isKeepEmptyMacros()
      Returns true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String.
      java.lang.String resolveMacros​(java.lang.String input)
      Resolves all macros in the input, replacing them with the macro values.
    • Method Detail

      • getMacroValue

        java.lang.String getMacroValue​(java.lang.String macro)
        Resolves a single macro to the macro value, returns null if the macro could not be resolved.

        Parameters:
        macro - the macro to resolve
        Returns:
        the resolved macro or null if the macro could not be resolved
      • isKeepEmptyMacros

        boolean isKeepEmptyMacros()
        Returns true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String.

        Returns:
        true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String
      • resolveMacros

        java.lang.String resolveMacros​(java.lang.String input)
        Resolves all macros in the input, replacing them with the macro values.

        The flag isKeepEmptyMacros() controls how to deal with macros found in the input that can not be resolved.

        Parameters:
        input - the input to resolve the macros in
        Returns:
        the input with all macros resolved