@param string Variable ID

@return VariableUsage Variable usage instance corresponding to given variable ID
492510
public function getVariableUsageById($variableId)
    {
        if (isset($this->_variableIdToVariableUsageInstanceMap[$variableId])) {
            return $this->_variableIdToVariableUsageInstanceMap[$variableId];
        } else {
            return null;
        }
    }
617330
private function getMethodsContainsVariable(array $methods, $variableName)
    {
        $methodsWithVariable = [];

        foreach ($methods as $method) {
            $propertyPostfixes = $method->findChildrenOfType('PropertyPostfix');

            /** @var AbstractNode $propertyPostfix */
            foreach ($propertyPostfixes as $propertyPostfix) {
                $identifier = $propertyPostfix->getFirstChildOfType('Identifier');

                if (null === $identifier) {
                    continue;
                }

                if ($variableName === $identifier->getName()) {
                    $methodsWithVariable[] = $method;

                    break;
                }
            }
        }

        return $methodsWithVariable;
    }
1165614
@Override
	public String onVariable(String variable) {
		String value = null;
		if(variables != null && variables.containsKey(variable)) {
			Object val = variables.get(variable);
			value = (val != null) ? val.toString() : null;
		}
		return value;
	}
1289375
def get_source_variable(self, source_id, variable):
        

        source_id = int(source_id)
        try:
            return self._retrieve_cached_source_variable(
                    source_id, variable)
        except UncachedVariable:
            return (yield from self._send_cmd("GET S[%d].%s" % (
                source_id, variable)))
898195
private function replaceVariablesString($value) {
    if (!is_string($value)) {
      return $value;
    }
    preg_match_all('/\{([^\{]+)\}/', $value, $variableMatches);
    $variables = $variableMatches[1];
    foreach($variables as $variable) {
      preg_match('/^([^:]+)[:]*(.*)$/', $variable, $matches);
      if (sizeof($matches > 0)) {
        $variableName = $matches[1];
        $parameters = $matches[2];
        $persistenceFacade = $this->getPersistenceFacade();

        // last_created_oid
        if ($variableName == 'last_created_oid') {
          $type = $parameters;
          if ($persistenceFacade->isKnownType($type)) {
            $oid = $persistenceFacade->getLastCreatedOID($type);
            $value = preg_replace("/{".$variable."}/", $oid, $value);
          }
        }

        // oid reference
        if ($persistenceFacade->isKnownType($variableName)) {
          $type = $variableName;
          $oid = $persistenceFacade->getLastCreatedOID($type);
          $value = $oid;
        }
      }
    }
    return $value;
  }
311682
public DifferentialFunction getVariableOutputFunction(String variableName) {
        Preconditions.checkState(variables.containsKey(variableName), "No variable with name \"%s\" found in graph", variableName);
        if(variables.get(variableName).getOutputOfOp() == null)
            return null;
        return ops.get(variables.get(variableName).getOutputOfOp()).getOp();
    }
549974
@Override
  public String expand(Map<String, ?> variables) {
    String name = this.name.expand(variables);
    return this.queryString(name, super.expand(variables));
  }
111254
public synchronized List<VariableDescription> getUsedVariableDescriptions(String template) {
		Template templateImpl = getTemplate(template, null);
		return templateImpl.getUsedVariableDescriptions();
	}
532163
public static Object getVariable(PageContext pc, Collection collection, String var) throws PageException {
	StringList list = parse(pc, new ParserString(var), false);
	if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");

	while (list.hasNextNext()) {
	    collection = Caster.toCollection(collection.get(KeyImpl.init(list.next())));
	}
	return collection.get(KeyImpl.init(list.next()));
    }
1346426
public function extractResultVariableProperty($variableId)
    {
        $variableIds = explode('http://',$variableId);
        $parts = explode(static::PROPERTY_SEPARATOR, $variableIds[2]);

        $itemUri = $variableIds[0] . 'http://' . $parts[0];
        $propertyName = empty($parts[1]) ? 'RESPONSE' : $parts[1];

        return [
            $itemUri,
            $propertyName
        ];
    }
583600
public JsStatement var(String variable)
	{
		JsStatement statement = new JsStatement();
		statements.add(statement);
		return statement.append(variable);
	}
694377
public <T extends Variable> T lookupVariable(String token) {
        Variable result = variables.get(token);
        return (T)result;
    }
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);

        }

      }

    }

  }
1216733
public String getAttributeId(int variableId) throws MIDDParsingException {
        if (!attributeMapper.containsValue(variableId)) {
            throw new MIDDParsingException("Variable identifier '" + variableId + "' not found");
        }

        for (String attrId : attributeMapper.keySet()) {
            if (attributeMapper.get(attrId) == variableId) {
                return attrId;
            }
        }

        throw new MIDDParsingException("Variable identifier '" + variableId + "' not found");
    }
661262
@SuppressWarnings("unchecked")
    public <T> T getValue(final String variableName) {
        final Variable variable = getVariable(variableName);
        return (variable == null) ? null : (T) variable.getValue();
    }
1112685
public VariableInfo findVariable(String name) {
    for (ContextLayer contextLayer : contextLayers) {
      VariableInfo variableInfo = contextLayer.getVariableInfo(name);
      if (variableInfo != null) {
        return variableInfo;
      }
    }

    return null;
  }
517638
@Override
  public QueryBuilder<V> withBindVariableValue(String key, V value) {
    valueMap.put(key, value);
    return this;
  }