public Set<String> getVariableNameUsedBy(String variableName) { Set<String> statements = statementVariableRef.getStatementNamesForVar(variableName); if ((statements == null) || (statements.isEmpty())) { return Collections.emptySet(); } return Collections.unmodifiableSet(statements); }
public boolean removeVariable(String name, boolean force) throws ConfigurationException { if (!force) { Set<String> statements = statementVariableRef.getStatementNamesForVar(name); if ((statements != null) && (!statements.isEmpty())) { throw new ConfigurationException( "Variable '" + name + "' is in use by one or more statements"); } } VariableReader reader = variableService.getReader(name); if (reader == null) { return false; } variableService.removeVariable(name); statementVariableRef.removeReferencesVariable(name); statementVariableRef.removeConfiguredVariable(name); return true; }