Class MacroResolverImpl

java.lang.Object
org.craftercms.engine.macro.impl.MacroResolverImpl
All Implemented Interfaces:
MacroResolver

public class MacroResolverImpl extends Object implements MacroResolver
Default implementation of MacroResolver. Uses a chain of Macros to resolve the macros. After that, the specified additional macro values are replaced.
Author:
Alfonso Vásquez
  • Constructor Details

    • MacroResolverImpl

      public MacroResolverImpl()
  • Method Details

    • setMacros

      public void setMacros(List<Macro> macros)
    • resolveMacros

      public String resolveMacros(String str)
      Description copied from interface: MacroResolver
      Resolve the macros found in the string.
      Specified by:
      resolveMacros in interface MacroResolver
      Parameters:
      str - the string with the macros
      Returns:
      the resolved string
    • resolveMacros

      public String resolveMacros(String str, Map<String,?> macroValues)
      Description copied from interface: MacroResolver
      Resolve the macros found in the string.
      Specified by:
      resolveMacros in interface MacroResolver
      Parameters:
      str - the string with the macros
      macroValues - additional macros values
      Returns:
      the resolved string