Source Code#
import java.util.*; // Java utility classes and data structures import com.ecyrd.jspwiki.*; import com.ecyrd.jspwiki.plugin.*; public class showParameters implements WikiPlugin { public String execute (WikiContext Context, Map ParameterMap) throws PluginException { String Result = "<h4>showParameters - lists the given plugin parameters</h4>\n"; /**** take care of a missing ParameterMap (may that ever happen?) ****/ if (ParameterMap == null) { return Result + "(no parameters given)"; }; /**** otherwise retrieve (and show) any given parameters ****/ Iterator ParameterInterator = ParameterMap.keySet().iterator(); if (!ParameterInterator.hasNext()) { // this looks probable return Result + "(no parameters given)"; }; Result += "<dl>"; while (ParameterInterator.hasNext()) { Object Key = ParameterInterator.next(); Result += "<dt>" + Key + (Key != null ? " (" + Key.getClass().getName() + ")" : "") + "\n"; Object Value = (Key == null ? null : ParameterMap.get(Key)); if (Value == null) { Result += "<dd>(null)"; } else { if (Value instanceof String) { Result += "<dd>\"" + Value + "\""; } else { Result += "<dd>(" + Value.getClass().getName() + ") " + Value + "\n"; }; }; }; return Result + "</dl>"; }; };
Andreas Rozek (EMail: Andreas.Rozek@GMX.De
)
Add new attachment
Only authorized users are allowed to upload new attachments.
«
This particular version was published on 09-Apr-2003 15:51 by 129.69.13.219.