Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Code Block
languagejava
themeEclipse
@Override
protected void setupParameters() {
    Parameter p = new Parameter();
    ... 

    addParameter(p);
}

 

 

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.


public final Object getParameterValue(String key)

This method returns the current value for the parameter with unique key ‘key’.

Example:

Code Block
languagejava
themeEclipse
Object paramVal = getParameterValue("SOME_KEY");
if (paramVal != null && paramVal.equals("INTERESTING_CONFIG")) {
   // Do something interesting
   ...
}


public void setParameterValue(String key, Object value)

This method sets the stored value for a parameter key.


Example:

 

Code Block
languagejava
themeEclipse
Object paramVal = getParameterValue("SOME_KEY");
if (shouldChangeThisValue(paramVal)) {
   Object newValue = new Object();
   setParameterValue("SOME_KEY", newValue);
}

 


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
languagejava
themeEclipse
Object paramVal = getParameterValue("SOME_KEY");
if (shouldRemoveThisValue(paramVal)) {
   clearParameterValue("SOME_KEY");
}

 

 

public void getParameter(String key)

Retrieves a previously set up parameter with the given key. Returns null if no parameter with this key exists.


Example:

 

Code Block
languagejava
themeEclipse
if (needToUpdateParameter()) {
   Parameter p = getParameter("SOME_KEY");
   ... 
}

 




Section
Column
width75

 Previous topic:

Column

Next topic: