Package com.day.cq.mailer.commons
Class ProfileVariableSubstitutor
- java.lang.Object
-
- org.apache.commons.lang.text.StrSubstitutor
-
- com.day.cq.mailer.commons.ProfileVariableSubstitutor
-
public class ProfileVariableSubstitutor extends StrSubstitutor
Extents theStrSubstitutor
to clean up variables that have not been replaced.- Since:
- 5.4
- See Also:
StrSubstitutor
-
-
Field Summary
-
Fields inherited from class org.apache.commons.lang.text.StrSubstitutor
DEFAULT_ESCAPE, DEFAULT_PREFIX, DEFAULT_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description ProfileVariableSubstitutor(StrLookup lookup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
replace(java.lang.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.-
Methods inherited from class org.apache.commons.lang.text.StrSubstitutor
getEscapeChar, getVariablePrefixMatcher, getVariableResolver, getVariableSuffixMatcher, isEnableSubstitutionInVariables, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceIn, replaceIn, replaceIn, replaceIn, replaceSystemProperties, setEnableSubstitutionInVariables, setEscapeChar, setVariablePrefix, setVariablePrefix, setVariablePrefixMatcher, setVariableResolver, setVariableSuffix, setVariableSuffix, setVariableSuffixMatcher
-
-
-
-
Constructor Detail
-
ProfileVariableSubstitutor
public ProfileVariableSubstitutor(StrLookup lookup)
-
-
Method Detail
-
replace
public java.lang.String replace(java.lang.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. ifdoCleanup
non replaced variables are removed (i.e. replaced by "").- Parameters:
source
- - the string to replace in, null returns nulldoCleanup
- - True to do the clean up- Returns:
- the result of the replace operation
-
-