/** * Returns the key set for this tool. If no key has been explicitly * set, this will return the result of {@link #getDefaultKey()}. * @return tool key */ public String getKey() { if (this.key != null) { return this.key; } return getDefaultKey(); }
public void setKey(String key) { this.key = key; // ensure any non-default key is also set as a property if (key != null && !key.equals(getDefaultKey())) { setProperty(ToolContext.TOOLKEY_KEY, key); } }