Sets whether whether variables should be interpolated in String values.
@since 4.0
974905
public CommandLine setInterpolateVariables(boolean interpolate) {
        getCommandSpec().interpolateVariables(interpolate);
        for (CommandLine command : getCommandSpec().subcommands().values()) {
            command.setInterpolateVariables(interpolate);
        }
        return this;
    }
18091
@Override
    public void setNString(int parameterIndex, String value) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        throw SQLError.noSupport();
    }
429788
protected void setVariable(String variableName, Object value, ExecutionEntity sourceExecution, boolean fetchAllVariables) {

    if (fetchAllVariables == true) {

      // If it's in the cache, it's more recent
      if (usedVariablesCache.containsKey(variableName)) {
        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);
      }

      // If the variable exists on this scope, replace it
      if (hasVariableLocal(variableName)) {
        setVariableLocal(variableName, value, sourceExecution, true);
        return;
      }

      // Otherwise, go up the hierarchy (we're trying to put it as high as possible)
      VariableScopeImpl parentVariableScope = getParentVariableScope();
      if (parentVariableScope != null) {
        if (sourceExecution == null) {
          parentVariableScope.setVariable(variableName, value);
        } else {
          parentVariableScope.setVariable(variableName, value, sourceExecution, true);
        }
        return;
      }

      // We're as high as possible and the variable doesn't exist yet, so
      // we're creating it
      if (sourceExecution != null) {
        createVariableLocal(variableName, value, sourceExecution);
      } else {
        createVariableLocal(variableName, value);
      }

    } else {

      // Check local cache first
      if (usedVariablesCache.containsKey(variableName)) {

        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);

      } else if (variableInstances != null && variableInstances.containsKey(variableName)) {

        updateVariableInstance(variableInstances.get(variableName), value, sourceExecution);

      } else {

        // Not in local cache, check if defined on this scope
        // Create it if it doesn't exist yet
        VariableInstanceEntity variable = getSpecificVariable(variableName);
        if (variable != null) {
          updateVariableInstance(variable, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);
        } else {

          VariableScopeImpl parent = getParentVariableScope();
          if (parent != null) {
            if (sourceExecution == null) {
              parent.setVariable(variableName, value, fetchAllVariables);
            } else {
              parent.setVariable(variableName, value, sourceExecution, fetchAllVariables);
            }

            return;
          }

          variable = createVariableInstance(variableName, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);

        }

      }

    }

  }
679552
private void initValues() throws VarExploderException
    {

        Class<?> c = source.getClass();
        if (c.isAnnotation() || c.isArray() || c.isEnum() || c.isPrimitive())
        {
            throw new IllegalArgumentException("The value must an object");
        }

        if(source instanceof Map )
        {
            this.pairs = (Map<String,Object>) source;
            return;
        }
        Method[] methods = c.getMethods();
        for (Method method : methods)
        {
            inspectGetters(method);
        }
        scanFields(c);
    }
87520
private static ValidationResult validateFormatStringVariable(
      ExpressionTree formatStringTree,
      final Symbol formatStringSymbol,
      final List<? extends ExpressionTree> args,
      final VisitorState state) {
    if (formatStringSymbol.getKind() != ElementKind.LOCAL_VARIABLE) {
      return ValidationResult.create(
          null,
          String.format(
              "Variables used as format strings that are not local variables must be compile time"
                  + " constants.\n%s is neither a local variable nor a compile time constant.",
              formatStringTree));
    }

    // Find the Tree for the block in which the variable is defined. If it is not defined in this
    // class (though it may have been in a super class). We require compile time constant values in
    // that case.
    Symbol owner = formatStringSymbol.owner;
    TreePath path = TreePath.getPath(state.getPath(), formatStringTree);
    while (path != null && ASTHelpers.getSymbol(path.getLeaf()) != owner) {
      path = path.getParentPath();
    }

    // A local variable must be declared in a parent tree to be accessed. This case should be
    // impossible.
    if (path == null) {
      throw new IllegalStateException(
          String.format(
              "Could not find the Tree where local variable %s is declared. "
                  + "This should be impossible.",
              formatStringTree));
    }

    // Scan down from the scope where the variable was declared
    ValidationResult result =
        path.getLeaf()
            .accept(
                new TreeScanner<ValidationResult, Void>() {
                  @Override
                  public ValidationResult visitVariable(VariableTree node, Void unused) {
                    if (ASTHelpers.getSymbol(node) == formatStringSymbol) {
                      if (node.getInitializer() == null) {
                        return ValidationResult.create(
                            null,
                            String.format(
                                "Variables used as format strings must be initialized when they are"
                                    + " declared.\nInvalid declaration: %s",
                                node));
                      }
                      return validateStringFromAssignment(node, node.getInitializer(), args, state);
                    }
                    return super.visitVariable(node, unused);
                  }

                  @Override
                  public ValidationResult reduce(ValidationResult r1, ValidationResult r2) {
                    if (r1 == null && r2 == null) {
                      return null;
                    }
                    return MoreObjects.firstNonNull(r1, r2);
                  }
                },
                null);

    return result;
  }
1276047
private boolean eachVariableOccursOnlyOnce() {
        int lit;
        for (int i = 0; i < this.addedlits.size(); i++) {
            lit = this.addedlits.get(i);
            assert marked(lit) == 0;
            assert marked(-lit) == 0;
        }
        boolean res = true;
        for (int i = 0; i < this.addedlits.size(); i++) {
            lit = this.addedlits.get(i);
            if (marked(lit) != 0 || marked(-lit) != 0) { res = false; } else { mark(lit); }
        }
        unmark();
        return res;
    }
128700
public final void setValues(@Nullable final Set<String> values) {
        if (values != null && !values.equals(this.values)) {
            this.values = values;
            persistSet(this.values);
            notifyChanged();
        }
    }
1134197
function(string, variables, shouldWrap) {
			var instance = this;

			return string.replace(INTERPOLATION_MATCHER, function(variable, variableName) {
				var value;

				// Either return the variable value or the original expression if it doesn't exist
				if (variables[variableName] !== undefined) {
					value = variables[variableName];
				} else if (process.env[variableName] !== undefined) {
					value = process.env[variableName];
				}

				if (value !== undefined) {
					if (shouldWrap) {
						// Escape all double quotes and wrap the value in double quotes
						return instance._wrap(variables[variableName]);
					}

					return value;
				}

				return variable;
			});
		}
700448
public synchronized boolean variablesChanged() {
        for (Map.Entry<String, Object> entry : variableCache.entrySet()) {
            String variableName = entry.getKey();
            Object oldVariableValue = entry.getValue();
            Object newVariableValue = lookupVariable(variableName);
            if (newVariableValue == null) {
                newVariableValue = defaultVariableCache.get(variableName);
            }
            if (!isEqual(oldVariableValue, newVariableValue)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Variable " + variableName + " has changed. Old value: " + oldVariableValue + " New value: " + newVariableValue);
                }
                return true;
            }
        }
        return false;
    }
755614
private void saveNestedVariables() {
	if (nestedVars != null) {
	    Iterator iter = nestedVars.iterator();
	    while (iter.hasNext()) {
		String varName = (String) iter.next();
		varName = findAlias(varName);
		Object obj = invokingJspCtxt.getAttribute(varName);
		if (obj != null) {
		    originalNestedVars.put(varName, obj);
		}
	    }
	}
    }
1305074
def pre_set(variable_string = nil)
      return if variable_string.nil? || variable_string == ""

      pairs = variable_string.split('&')
      pairs.each do |pair|
        next unless pair.index('=')
        variable, value = *pair.split('=')
        unless variable.nil? || variable == "" || value.nil? || value == ""
          variable = variable.strip.to_sym
          set(variable, value.strip)
          @pre_set_variables[variable] = value
        end
      end
    end
1135204
function interpolate(val, scope) {

        // if no scope or value with {{ then no interpolation and can just return translated
        if (!scope || !val || !val.match) { return val; }

        // first, we need to get all values with a {{ }} in the string
        var i18nVars = val.match(i18nVarExpr);

        // loop through {{ }} values
        _.each(i18nVars, function (i18nVar) {
            var field = i18nVar.substring(2, i18nVar.length - 2).trim();
            var scopeVal = getScopeValue(scope, field);
            val = val.replace(i18nVar, scopeVal);
        });

        return val;
    }
470226
public boolean isInValueSet(Value value) {
        if (value == null) {
            throw new IllegalArgumentException("value cannot be null");
        }

        boolean result = true;
        if (!this.valuesKeySet.isEmpty()) {
            result = this.valuesKeySet.contains(value);
        } else if (this.lowerBound != null || this.upperBound != null) {
            if (this.lowerBound != null
                    && !ValueComparator.GREATER_THAN_OR_EQUAL_TO.compare(
                    value, this.lowerBound)) {
                result = false;
            }
            if (this.upperBound != null
                    && !ValueComparator.LESS_THAN_OR_EQUAL_TO.compare(
                    value, this.upperBound)) {
                result = false;
            }
        }
        return result;
    }
1050809
private static boolean isVariableInteger(TokenList.Token t) {
        if( t == null )
            return false;

        return t.getScalarType() == VariableScalar.Type.INTEGER;
    }
1231482
protected Long eval(final Object... _values)
    {
        final Long ret;

        if (_values == null || _values.length == 0 || _values[0] == null)  {
            ret = null;
        } else if (_values[0] instanceof String && !"".equals(_values[0])) {
            ret = Long.parseLong((String) _values[0]);
        } else if (_values[0] instanceof Number) {
            ret = ((Number) _values[0]).longValue();
        } else  {
            ret = null;
        }

        return ret;
    }
119221
public void setStrings(String name, String... values) {
        set(name, StringUtils.join(values, ","));
    }
345610
public void setVariableNotationPatterns(String... variableNotationPatterns) {
        this.variableNotationPatterns = Arrays.asList(variableNotationPatterns);

        String pattern = "(.*?)";
        allVariablesPattern = "((" + this.variableNotationPatterns.get(0) + ")";
        for (int i = 1; i < this.variableNotationPatterns.size(); i++) {
            allVariablesPattern += "|(" + this.variableNotationPatterns.get(i) + ")";
        }
        allVariablesPattern += ")";
        pattern += allVariablesPattern;
        regexPattern = Pattern.compile(pattern);
    }