/** * Returns an instance of {@link BufferedConfigurationExplorer}. * @return an instance of {@link BufferedConfigurationExplorer}. */ @Override protected ConfigurationExplorer getExplorer() { return new BufferedConfigurationExplorer(conf.getRoot()); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>null</code> if it wasn't set. */ public synchronized String removeVariable(String name) { BufferedConfigurationExplorer explorer; // Used to navigate to the variable's parent section. String buffer; // Buffer for the variable's name trimmed of section information. // If the variable's 'path' doesn't exist, return null. if((buffer = moveToParent(explorer = new BufferedConfigurationExplorer(root), name, false)) == null) return null; // If the variable was actually set, triggers an event. if((buffer = explorer.getSection().removeVariable(buffer)) != null) { prune(explorer); triggerEvent(new ConfigurationEvent(this, name, null)); } return buffer; }