Class SystemPropertyAndEnvironmentSubstitutor


  • public class SystemPropertyAndEnvironmentSubstitutor
    extends org.apache.commons.text.StringSubstitutor
    A StringSubstitutor that picks properties from System.getProperty(String) (preferred) and System.getenv(String) (secondary) that may be modified by operators. Substitution variables are identified according the defaults of StringSubstitutor.
    See Also:
    Details about lookup and modification by operators
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SystemPropertyAndEnvironmentSubstitutor

        public SystemPropertyAndEnvironmentSubstitutor()
      • SystemPropertyAndEnvironmentSubstitutor

        public SystemPropertyAndEnvironmentSubstitutor​(boolean strict)
      • SystemPropertyAndEnvironmentSubstitutor

        public SystemPropertyAndEnvironmentSubstitutor​(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