org.xwiki.extension.wrap
Class WrappingExtension<E extends Extension>

java.lang.Object
  extended by org.xwiki.extension.wrap.AbstractWrappingObject<E>
      extended by org.xwiki.extension.wrap.WrappingExtension<E>
Type Parameters:
E - the extension type
All Implemented Interfaces:
Extension
Direct Known Subclasses:
WrappingCoreExtension, WrappingLocalExtension

public class WrappingExtension<E extends Extension>
extends AbstractWrappingObject<E>
implements Extension

Wrap an extension.

Since:
4.0M1
Version:
$Id$

Constructor Summary
WrappingExtension(E extension)
           
 
Method Summary
 Collection<ExtensionAuthor> getAuthors()
           
 Collection<? extends ExtensionDependency> getDependencies()
           
 String getDescription()
           
 Collection<String> getFeatures()
          The idea is to indicate in an extension a list of provided "functionalities".
 ExtensionFile getFile()
          Return extension file descriptor.
 ExtensionId getId()
           
 Collection<ExtensionLicense> getLicenses()
           
 String getName()
           
 Map<String,Object> getProperties()
          Extends Extension standard properties.
 Object getProperty(String key)
           
<T> T
getProperty(String key, T def)
          Get a property.
 ExtensionRepository getRepository()
           
 String getSummary()
           
 String getType()
           
 String getWebSite()
           
 
Methods inherited from class org.xwiki.extension.wrap.AbstractWrappingObject
equals, getWrapped, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappingExtension

public WrappingExtension(E extension)
Parameters:
extension - the wrapped extension
Method Detail

getId

public ExtensionId getId()
Specified by:
getId in interface Extension
Returns:
the id/version combination which makes the extension unique

getFeatures

public Collection<String> getFeatures()
Description copied from interface: Extension
The idea is to indicate in an extension a list of provided "functionalities". Then when resolving extensions dependencies the dependencies id could be matched in this list.

Specified by:
getFeatures in interface Extension
Returns:
the extension ids also provided by this extension, an empty collection if there is none

getType

public String getType()
Specified by:
getType in interface Extension
Returns:
the type of the extension

getName

public String getName()
Specified by:
getName in interface Extension
Returns:
the display name of the extension

getLicenses

public Collection<ExtensionLicense> getLicenses()
Specified by:
getLicenses in interface Extension
Returns:
the license of the extension, an empty collection if there is none

getSummary

public String getSummary()
Specified by:
getSummary in interface Extension
Returns:
a short description of the extension

getDescription

public String getDescription()
Specified by:
getDescription in interface Extension
Returns:
a description of the extension

getWebSite

public String getWebSite()
Specified by:
getWebSite in interface Extension
Returns:
an URL for the extension website

getAuthors

public Collection<ExtensionAuthor> getAuthors()
Specified by:
getAuthors in interface Extension
Returns:
the extension authors, an empty collection if there is none

getDependencies

public Collection<? extends ExtensionDependency> getDependencies()
Specified by:
getDependencies in interface Extension
Returns:
the dependencies of the extension, an empty collection if there is none

getFile

public ExtensionFile getFile()
Description copied from interface: Extension
Return extension file descriptor. Also allows to get the content of the file.

Specified by:
getFile in interface Extension
Returns:
the file of the extension

getRepository

public ExtensionRepository getRepository()
Specified by:
getRepository in interface Extension
Returns:
the repository of the extension

getProperties

public Map<String,Object> getProperties()
Description copied from interface: Extension
Extends Extension standard properties.

Theses are generally provided by specific repositories. For example a maven repository will provide group and artifacts ids.

Specified by:
getProperties in interface Extension
Returns:
the properties

getProperty

public Object getProperty(String key)
Specified by:
getProperty in interface Extension
Parameters:
key - the property key
Returns:
the property value

getProperty

public <T> T getProperty(String key,
                         T def)
Description copied from interface: Extension
Get a property.

Specified by:
getProperty in interface Extension
Type Parameters:
T - type of the property value
Parameters:
key - the property key
def - the value to return if no property is associated to the provided key
Returns:
the property value or default of the property is not found
See Also:
Extension.getProperty(String)


Copyright © 2004-2012 XWiki. All Rights Reserved.