Page History
...
Code Block | ||||
---|---|---|---|---|
| ||||
@Override protected void setupParameters() { Parameter p = new Parameter(); ... addParameter(p); } |
Styleclass | ||
---|---|---|
| ||
Anchor addParam addParam
protected final void addParameter(Parameter p)
Plugins should use this method to notify the API of any new parameters it creates. Note that new parameters will not be persisted if they are added outside of the setupParameters method. See above example.
Styleclass | ||
---|---|---|
| ||
Anchor getParamVal getParamVal
public final Object getParameterValue(String key)
This method returns the current value for the parameter with unique key ‘key’.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
Object paramVal = getParameterValue("SOME_KEY"); if (paramVal != null && paramVal.equals("INTERESTING_CONFIG")) { // Do something interesting ... } |
Styleclass | ||
---|---|---|
| ||
Anchor setParamVal setParamVal
public void setParameterValue(String key, Object value)
This method sets the stored value for a parameter key.
Code Block | ||||
---|---|---|---|---|
| ||||
Object paramVal = getParameterValue("SOME_KEY"); if (shouldChangeThisValue(paramVal)) { Object newValue = new Object(); setParameterValue("SOME_KEY", newValue); } |
Styleclass | ||
---|---|---|
| ||
Anchor clearParamVal clearParamVal
public void clearParameterValue(String key)
Equivalent to calling setParameterValue(key, null); except that this method also removes the parameter key from the parameter values map.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
Object paramVal = getParameterValue("SOME_KEY"); if (shouldRemoveThisValue(paramVal)) { clearParameterValue("SOME_KEY"); } |
Styleclass | ||
---|---|---|
| ||
Anchor | ||||
---|---|---|---|---|
|
public void getParameter(String key)
Retrieves a previously set up parameter with the given key. Returns null if no parameter with this key exists.
Code Block | ||||
---|---|---|---|---|
| ||||
if (needToUpdateParameter()) { Parameter p = getParameter("SOME_KEY"); ... } |
Styleclass | ||
---|---|---|
| ||
Section | |||||||
---|---|---|---|---|---|---|---|
|