org.xwiki.extension.wrap
Class WrappingInstalledExtension<E extends InstalledExtension>

java.lang.Object
  extended by org.xwiki.extension.wrap.AbstractWrappingObject<E>
      extended by org.xwiki.extension.wrap.WrappingExtension<T>
          extended by org.xwiki.extension.wrap.WrappingLocalExtension<E>
              extended by org.xwiki.extension.wrap.WrappingInstalledExtension<E>
Type Parameters:
E - the extension type
All Implemented Interfaces:
Extension, InstalledExtension, LocalExtension

public class WrappingInstalledExtension<E extends InstalledExtension>
extends WrappingLocalExtension<E>
implements InstalledExtension

Wrap a local extension.

Since:
4.0M2
Version:
$Id$

Field Summary
 
Fields inherited from interface org.xwiki.extension.InstalledExtension
PKEY_DEPENDENCY, PKEY_INSTALLED, PKEY_NAMESPACES
 
Fields inherited from interface org.xwiki.extension.LocalExtension
PKEY_FILE
 
Constructor Summary
WrappingInstalledExtension(E localExtension)
           
 
Method Summary
 LocalExtension getLocalExtension()
           
 Collection<String> getNamespaces()
           
 boolean isDependency()
          Indicate if the extension as been installed as a dependency of another one.
 boolean isInstalled()
           
 boolean isInstalled(String namespace)
          Indicate if the extension is installed in the provided namespace.
 
Methods inherited from class org.xwiki.extension.wrap.WrappingLocalExtension
getFile
 
Methods inherited from class org.xwiki.extension.wrap.WrappingExtension
getAuthors, getDependencies, getDescription, getFeatures, getId, getLicenses, getName, getProperties, getProperty, getProperty, getRepository, getSummary, getType, 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
 
Methods inherited from interface org.xwiki.extension.LocalExtension
getFile
 
Methods inherited from interface org.xwiki.extension.Extension
getAuthors, getDependencies, getDescription, getFeatures, getId, getLicenses, getName, getProperties, getProperty, getProperty, getRepository, getSummary, getType, getWebSite
 

Constructor Detail

WrappingInstalledExtension

public WrappingInstalledExtension(E localExtension)
Parameters:
localExtension - the wrapped local extension
Method Detail

getLocalExtension

public LocalExtension getLocalExtension()
Specified by:
getLocalExtension in interface InstalledExtension
Returns:
the actual extension

isInstalled

public boolean isInstalled()
Specified by:
isInstalled in interface InstalledExtension
Returns:
indicate if the extension is installed

isInstalled

public boolean isInstalled(String namespace)
Description copied from interface: InstalledExtension
Indicate if the extension is installed in the provided namespace.

Specified by:
isInstalled in interface InstalledExtension
Parameters:
namespace - the namespace to look at, if null it means the extension is installed for all the namespaces
Returns:
true if the extension is installed in the provided namespace

getNamespaces

public Collection<String> getNamespaces()
Specified by:
getNamespaces in interface InstalledExtension
Returns:
the namespaces in which this extension is enabled. Null means root namespace (i.e all namespaces).

isDependency

public boolean isDependency()
Description copied from interface: InstalledExtension
Indicate if the extension as been installed as a dependency of another one.

The idea is to be able to make the difference between extension specifically installed by a user so that it's possible to know which extension are not really required anymore.

Specified by:
isDependency in interface InstalledExtension
Returns:
true if the the extension has been installed only because it was a dependency of another extension


Copyright © 2004-2012 XWiki. All Rights Reserved.