com.ecyrd.jspwiki.parser
Class PluginContent

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Text
          extended by com.ecyrd.jspwiki.parser.PluginContent
All Implemented Interfaces:
Serializable, Cloneable

public class PluginContent
extends Text

Stores the contents of a plugin in a WikiDocument DOM tree.

If the RenderingManager.WYSIWYG_EDITOR_MODE is set to Boolean.TRUE in the context, then the plugin is rendered as WikiMarkup. This allows an HTML editor to work without rendering the plugin each time as well.

If RenderingManager.VAR_EXECUTE_PLUGINS is set to Boolean.FALSE, then the plugin is not executed.

Since:
2.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jdom.Text
value
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
PluginContent(String pluginName, Map parameters)
          Creates a new DOM element with the given plugin name and a map of parameters.
 
Method Summary
 void executeParse(WikiContext context)
          Executes the executeParse() method.
 Object getParameter(String name)
          Returns a parameter value from the parameter map.
 Map getParameters()
          Returns the parameter map given in the constructor.
 String getPluginName()
          Returns the name of the plugin invoked by the DOM element.
 String getText()
          The main invocation for the plugin.
 String getValue()
          Returns the rendered plugin.
 
Methods inherited from class org.jdom.Text
append, append, clone, getTextNormalize, getTextTrim, normalizeString, setText, toString
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginContent

public PluginContent(String pluginName,
                     Map parameters)
Creates a new DOM element with the given plugin name and a map of parameters.

Parameters:
pluginName - The FQN of a plugin.
parameters - A Map of parameters.
Method Detail

getPluginName

public String getPluginName()
Returns the name of the plugin invoked by the DOM element.

Returns:
Name of the plugin
Since:
2.5.7

getParameter

public Object getParameter(String name)
Returns a parameter value from the parameter map.

Parameters:
name - the name of the parameter.
Returns:
The value from the map, or null, if no such parameter exists.

getParameters

public Map getParameters()
Returns the parameter map given in the constructor.

Returns:
The parameter map.

getValue

public String getValue()
Returns the rendered plugin. Only calls getText().

Overrides:
getValue in class Text
Returns:
HTML

getText

public String getText()
The main invocation for the plugin. When the getText() is called, it invokes the plugin and returns its contents. If there is no Document yet, only returns the plugin name itself.

Overrides:
getText in class Text
Returns:
The plugin rendered according to the options set in the WikiContext.

executeParse

public void executeParse(WikiContext context)
                  throws PluginException
Executes the executeParse() method.

Parameters:
context - The WikiContext
Throws:
PluginException - If something goes wrong.