Class ProfileVariableSubstitutor

java.lang.Object
org.apache.commons.lang.text.StrSubstitutor
com.day.cq.mailer.commons.ProfileVariableSubstitutor

public class ProfileVariableSubstitutor extends StrSubstitutor
Extents the StrSubstitutor to clean up variables that have not been replaced.
Since:
5.4
See Also:
  • Constructor Details

    • ProfileVariableSubstitutor

      public ProfileVariableSubstitutor(StrLookup lookup)
  • Method Details

    • replace

      public String replace(String source, boolean doCleanup)
      Replaces all the occurrences of variables with their matching values from the resolver using the given source string as a template. if doCleanup non replaced variables are removed (i.e. replaced by "").
      Parameters:
      source - - the string to replace in, null returns null
      doCleanup - - True to do the clean up
      Returns:
      the result of the replace operation