Package org.apache.wiki.plugin
Class DefaultPluginManager.WikiPluginInfo
java.lang.Object
org.apache.wiki.modules.WikiModuleInfo
org.apache.wiki.plugin.DefaultPluginManager.WikiPluginInfo
- All Implemented Interfaces:
java.lang.Comparable<WikiModuleInfo>
- Enclosing class:
- DefaultPluginManager
public static final class DefaultPluginManager.WikiPluginInfo extends WikiModuleInfo
Contains information about a bunch of plugins.
-
Field Summary
Fields inherited from class org.apache.wiki.modules.WikiModuleInfo
m_adminBeanClass, m_author, m_authorUrl, m_description, m_htmlTemplate, m_maxVersion, m_minVersion, m_moduleUrl, m_moduleVersion, m_name, m_resource, m_scriptLocation, m_scriptText, m_stylesheetLocation, m_stylesheetText -
Method Summary
Modifier and Type Method Description java.lang.StringgetAjaxAlias()Returns the ajax alias name for this object.java.lang.StringgetAlias()Returns the alias name for this object.java.lang.StringgetClassName()Returns the full class name of this object.java.lang.StringgetIncludeText(java.lang.String type)Returns a text for IncludeResources.protected voidinitializeFromXML(org.jdom2.Element el)Initializes the ModuleInfo from some standard XML elements which are under the given element.protected voidinitializePlugin(DefaultPluginManager.WikiPluginInfo info, Engine engine, java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars)Initializes a plugin, if it has not yet been initialized.protected static DefaultPluginManager.WikiPluginInfonewInstance(java.lang.Class<?> clazz)Create a new WikiPluginInfo based on the Class information.protected static DefaultPluginManager.WikiPluginInfonewInstance(java.lang.String className, org.jdom2.Element el, java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars)Creates a new plugin info object which can be used to access a plugin.PluginnewPluginInstance(java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars)Creates a new plugin instance.java.lang.StringtoString()Returns a string suitable for debugging.Methods inherited from class org.apache.wiki.modules.WikiModuleInfo
compareTo, equals, getAdminBeanClass, getAuthor, getAuthorUrl, getDescription, getHtmlTemplate, getMaxVersion, getMinVersion, getModuleUrl, getModuleVersion, getName, getScriptLocation, getStylesheetLocation, getTextResource, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
newInstance
protected static DefaultPluginManager.WikiPluginInfo newInstance(java.lang.String className, org.jdom2.Element el, java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars)Creates a new plugin info object which can be used to access a plugin.- Parameters:
className- Either a fully qualified class name, or a "short" name which is then checked against the internal list of plugin packages.el- A JDOM Element containing the information about this class.searchPath- A List of Strings, containing different package names.externalJars- the list of external jars to search- Returns:
- A WikiPluginInfo object.
-
initializePlugin
protected void initializePlugin(DefaultPluginManager.WikiPluginInfo info, Engine engine, java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars)Initializes a plugin, if it has not yet been initialized. If the plugin extendsHttpServletit will automatically register it as AJAX usingWikiAjaxDispatcherServlet.registerServlet(String, WikiAjaxServlet).- Parameters:
engine- The EnginesearchPath- A List of Strings, containing different package names.externalJars- the list of external jars to search
-
initializeFromXML
Initializes the ModuleInfo from some standard XML elements which are under the given element.- Overrides:
initializeFromXMLin classWikiModuleInfo- Parameters:
el- The element to parse.
-
newInstance
Create a new WikiPluginInfo based on the Class information.- Parameters:
clazz- The class to check- Returns:
- A WikiPluginInfo instance
-
getClassName
Returns the full class name of this object.- Returns:
- The full class name of the object.
-
getAlias
Returns the alias name for this object.- Returns:
- An alias name for the plugin.
-
getAjaxAlias
Returns the ajax alias name for this object.- Returns:
- An ajax alias name for the plugin.
-
newPluginInstance
public Plugin newPluginInstance(java.util.List<java.lang.String> searchPath, java.util.List<java.lang.String> externalJars) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessExceptionCreates a new plugin instance.- Parameters:
searchPath- A List of Strings, containing different package names.externalJars- the list of external jars to search- Returns:
- A new plugin.
- Throws:
java.lang.ClassNotFoundException- If the class declared was not found.java.lang.InstantiationException- If the class cannot be instantiated-java.lang.IllegalAccessException- If the class cannot be accessed.
-
getIncludeText
Returns a text for IncludeResources.- Parameters:
type- Either "script" or "stylesheet"- Returns:
- Text, or an empty string, if there is nothing to be included.
-
toString
Returns a string suitable for debugging. Don't assume that the format would stay the same.- Overrides:
toStringin classjava.lang.Object- Returns:
- Something human-readable
-