Class AbstractWrappingExtension<E extends Extension>

java.lang.Object
org.xwiki.script.wrap.AbstractWrappingObject<T>
org.xwiki.extension.wrap.AbstractWrappingObject<E>
org.xwiki.extension.wrap.AbstractWrappingExtension<E>
Type Parameters:
E - the extension type
All Implemented Interfaces:
Comparable<Extension>, Extension
Direct Known Subclasses:
WrappingExtension

public abstract class AbstractWrappingExtension<E extends Extension> extends AbstractWrappingObject<E> implements Extension
Wrap an extension.
Since:
12.9RC1
Version:
$Id: 43336ed1f8f9563ba965de96a1e629f9c18c67fc $
  • Field Details

  • Constructor Details

    • AbstractWrappingExtension

      public AbstractWrappingExtension(E extension)
      Parameters:
      extension - the wrapped extension
    • AbstractWrappingExtension

      protected AbstractWrappingExtension()
      A default constructor allowing to set the wrapped object later.
  • Method Details

    • setOverwrite

      public void setOverwrite(String key, Object value)
      Parameters:
      key - the key associated to the Extension field (usually found in Extension constants) to overwrite
      value - the value to overwrite
      Since:
      9.0RC1, 8.4.2
    • get

      public <T> T get(String fieldName)
      Description copied from interface: Extension
      Get an extension field (name, summary, id, etc.) by name. Fallback on properties.
      Specified by:
      get in interface Extension
      Type Parameters:
      T - type of the field value
      Parameters:
      fieldName - the field name;
      Returns:
      the field value or null if none could be found
    • getId

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

      @Deprecated public Collection<String> getFeatures()
      Deprecated.
      Description copied from interface: Extension
      Indicate in an extension a list of provided "functionalities". Then when resolving extensions dependencies they can 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
    • getExtensionFeatures

      public Collection<ExtensionId> getExtensionFeatures()
      Description copied from interface: Extension
      Indicate in an extension a list of provided "functionalities". Then when resolving extensions dependencies they can be matched in this list.
      Specified by:
      getExtensionFeatures in interface Extension
      Returns:
      the ExtensionIds also provided by this extension, an empty collection if there is none
    • getExtensionFeature

      public ExtensionId getExtensionFeature(String featureId)
      Description copied from interface: Extension
      Return the ExtensionId object that matches the passed feature id.
      Specified by:
      getExtensionFeature in interface Extension
      Parameters:
      featureId - the id of the feature
      Returns:
      the ExtensionId associated to the passed id
    • getType

      public String getType()
      Specified by:
      getType in interface Extension
      Returns:
      the type of the extension, null if the extension does not have any associated file
    • 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
    • getComponents

      public Collection<ExtensionComponent> getComponents()
      Specified by:
      getComponents in interface Extension
      Returns:
      the XWiki components provided by the extension
    • getAllowedNamespaces

      public Collection<String> getAllowedNamespaces()
      Specified by:
      getAllowedNamespaces in interface Extension
      Returns:
      the namespaces where it's allowed to install this extension
    • getDependencies

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

      public Collection<ExtensionDependency> getManagedDependencies()
      Description copied from interface: Extension
      Managed dependencies are used to override transitive dependencies (usually the version of this transitive dependency).
      Specified by:
      getManagedDependencies in interface Extension
      Returns:
      the managed dependencies, empty list if there is none
    • getFile

      public ExtensionFile getFile()
      Description copied from interface: Extension
      Access the associated extension file content.
      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
    • getScm

      public ExtensionScm getScm()
      Specified by:
      getScm in interface Extension
      Returns:
      informations related to extensions's source control management
    • getIssueManagement

      public ExtensionIssueManagement getIssueManagement()
      Specified by:
      getIssueManagement in interface Extension
      Returns:
      informations related to extension's issues management
    • getCategory

      public String getCategory()
      Specified by:
      getCategory in interface Extension
      Returns:
      the category of the extension
    • getRepositories

      public Collection<ExtensionRepositoryDescriptor> getRepositories()
      Specified by:
      getRepositories in interface Extension
      Returns:
      the custom repositories provided by the extension (usually to resolve dependencies)
    • 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 <T> T getProperty(String key)
      Specified by:
      getProperty in interface Extension
      Type Parameters:
      T - type of the property value
      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:
    • compareTo

      public int compareTo(Extension o)
      Specified by:
      compareTo in interface Comparable<E extends Extension>