Package org.apache.wiki.parser

# Class PluginContent

java.lang.Object
org.jdom2.Content
org.jdom2.Text
org.apache.wiki.parser.PluginContent

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `org.apache.wiki.api.plugin.PluginElement`, `org.jdom2.NamespaceAware`

public class PluginContent extends org.jdom2.Text implements org.apache.wiki.api.plugin.PluginElement
Stores the contents of a plugin in a WikiDocument DOM tree.

If the Context.VAR_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 Context.VAR_EXECUTE_PLUGINS is set to Boolean.FALSE, then the plugin is not executed.

Since:
  2.4
See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from class org.jdom2.Content

`org.jdom2.Content.CType`

## Field Summary

### Fields inherited from class org.jdom2.Text

`value`

### Fields inherited from class org.jdom2.Content

`ctype, parent`

## Constructor Summary

Constructors
Constructor
Description
`PluginContent(String pluginName, Map<String,String> parameters)`
Creates a new DOM element with the given plugin name and a map of parameters.

## Method Summary

Modifier and Type
Method
Description
`void`
`executeParse(org.apache.wiki.api.core.Context context)`
`String`
`getParameter(String name)`
`Map<String,String>`
`getParameters()`
`String`
`getPluginName()`
`String`
`getText()`
`String`
`getValue()`
`String`
`invoke(org.apache.wiki.api.core.Context context)`
`static PluginContent`
`parsePluginLine(org.apache.wiki.api.core.Context context, String commandline, int pos)`
Parses a plugin invocation and returns a DOM element.

### Methods inherited from class org.jdom2.Text

`append, append, clone, detach, getParent, getTextNormalize, getTextTrim, normalizeString, setParent, setText, toString`

### Methods inherited from class org.jdom2.Content

`equals, getCType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParentElement, hashCode`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### PluginContent

public PluginContent(String pluginName, Map<String,String> 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 Details

### getPluginName

public String getPluginName()

Specified by:
  `getPluginName` in interface `org.apache.wiki.api.plugin.PluginElement`

### getParameter

public String getParameter(String name)

Specified by:
  `getParameter` in interface `org.apache.wiki.api.plugin.PluginElement`

### getParameters

public Map<String,String> getParameters()

Specified by:
  `getParameters` in interface `org.apache.wiki.api.plugin.PluginElement`

### getValue

public String getValue()

Specified by:
  `getValue` in interface `org.apache.wiki.api.plugin.PluginElement`
Overrides:
  `getValue` in class `org.jdom2.Text`

### getText

public String getText()

Specified by:
  `getText` in interface `org.apache.wiki.api.plugin.PluginElement`
Overrides:
  `getText` in class `org.jdom2.Text`

### invoke

public String invoke(org.apache.wiki.api.core.Context context)

Specified by:
  `invoke` in interface `org.apache.wiki.api.plugin.PluginElement`

### executeParse

public void executeParse(org.apache.wiki.api.core.Context context) throws org.apache.wiki.api.exceptions.PluginException

Specified by:
  `executeParse` in interface `org.apache.wiki.api.plugin.PluginElement`
Throws:
  `org.apache.wiki.api.exceptions.PluginException`

### parsePluginLine

public static PluginContent parsePluginLine(org.apache.wiki.api.core.Context context, String commandline, int pos) throws org.apache.wiki.api.exceptions.PluginException
Parses a plugin invocation and returns a DOM element.

Parameters:
  `context` - The WikiContext
  `commandline` - The line to parse
  `pos` - The position in the stream parsing.
Returns:
  A DOM element
Throws:
  `org.apache.wiki.api.exceptions.PluginException` - If plugin invocation is faulty
Since:
  2.10.0