Class EnvironmentVariableSubstitutor


  • public class EnvironmentVariableSubstitutor
    extends org.apache.commons.text.StringSubstitutor
    A custom StringSubstitutor using environment variables as lookup source.
    • Field Summary

      • Fields inherited from class org.apache.commons.text.StringSubstitutor

        DEFAULT_ESCAPE, DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_VALUE_DELIMITER, DEFAULT_VAR_DEFAULT, DEFAULT_VAR_END, DEFAULT_VAR_START
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean substitute​(org.apache.commons.text.TextStringBuilder buf, int offset, int length)  
      • Methods inherited from class org.apache.commons.text.StringSubstitutor

        createInterpolator, getEscapeChar, getStringLookup, getValueDelimiterMatcher, getVariablePrefixMatcher, getVariableSuffixMatcher, isDisableSubstitutionInValues, isEnableSubstitutionInVariables, isEnableUndefinedVariableException, isPreserveEscapes, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceIn, replaceIn, replaceIn, replaceIn, replaceIn, replaceIn, replaceSystemProperties, resolveVariable, setDisableSubstitutionInValues, setEnableSubstitutionInVariables, setEnableUndefinedVariableException, setEscapeChar, setPreserveEscapes, setValueDelimiter, setValueDelimiter, setValueDelimiterMatcher, setVariablePrefix, setVariablePrefix, setVariablePrefixMatcher, setVariableResolver, setVariableSuffix, setVariableSuffix, setVariableSuffixMatcher
    • Constructor Detail

      • EnvironmentVariableSubstitutor

        public EnvironmentVariableSubstitutor()
      • EnvironmentVariableSubstitutor

        public EnvironmentVariableSubstitutor​(boolean strict)
      • EnvironmentVariableSubstitutor

        public EnvironmentVariableSubstitutor​(boolean strict,
                                              boolean substitutionInVariables)
        Parameters:
        strict - true if looking up undefined environment variables should throw a UndefinedEnvironmentVariableException, false otherwise.
        substitutionInVariables - a flag whether substitution is done in variable names.
        See Also:
        StringSubstitutor.setEnableSubstitutionInVariables(boolean)
    • Method Detail

      • substitute

        protected boolean substitute​(org.apache.commons.text.TextStringBuilder buf,
                                     int offset,
                                     int length)
        Overrides:
        substitute in class org.apache.commons.text.StringSubstitutor