Package org.xwiki.extension.wrap
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 Summary
Fields Modifier and Type Field Description protected Map<String,Object>overwrites-
Fields inherited from interface org.xwiki.extension.Extension
FIELD_ALLOWEDNAMESPACE, FIELD_ALLOWEDNAMESPACES, FIELD_AUTHOR, FIELD_AUTHORS, FIELD_CATEGORY, FIELD_COMPONENT, FIELD_COMPONENTS, FIELD_DEPENDENCIES, FIELD_DESCRIPTION, FIELD_EXTENSIONFEATURE, FIELD_EXTENSIONFEATURES, FIELD_FEATURE, FIELD_FEATURES, FIELD_ID, FIELD_ISSUEMANAGEMENT, FIELD_LICENSE, FIELD_LICENSES, FIELD_MANAGEDDEPENDENCIES, FIELD_NAME, FIELD_NAMESPACES, FIELD_PROPERTIES, FIELD_REPOSITORIES, FIELD_REPOSITORY, FIELD_SCM, FIELD_SUMMARY, FIELD_TYPE, FIELD_VERSION, FIELD_WEBSITE, IKEYPREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWrappingExtension()A default constructor allowing to set the wrapped object later.AbstractWrappingExtension(E extension)
-
Method Summary
-
-
-
Constructor Detail
-
AbstractWrappingExtension
public AbstractWrappingExtension(E extension)
- Parameters:
extension- the wrapped extension
-
AbstractWrappingExtension
protected AbstractWrappingExtension()
A default constructor allowing to set the wrapped object later.
-
-
Method Detail
-
setOverwrite
public void setOverwrite(String key, Object value)
- Parameters:
key- the key associated to the Extension field (usually found inExtensionconstants) to overwritevalue- the value to overwrite- Since:
- 9.0RC1, 8.4.2
-
get
public <T> T get(String fieldName)
Description copied from interface:ExtensionGet an extension field (name, summary, id, etc.) by name. Fallback on properties.
-
getId
public ExtensionId getId()
-
getFeatures
@Deprecated public Collection<String> getFeatures()
Deprecated.Description copied from interface:ExtensionIndicate in an extension a list of provided "functionalities". Then when resolving extensions dependencies they can be matched in this list.- Specified by:
getFeaturesin interfaceExtension- 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:ExtensionIndicate in an extension a list of provided "functionalities". Then when resolving extensions dependencies they can be matched in this list.- Specified by:
getExtensionFeaturesin interfaceExtension- 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:ExtensionReturn theExtensionIdobject that matches the passed feature id.- Specified by:
getExtensionFeaturein interfaceExtension- Parameters:
featureId- the id of the feature- Returns:
- the
ExtensionIdassociated to the passed id
-
getType
public String getType()
-
getName
public String getName()
-
getLicenses
public Collection<ExtensionLicense> getLicenses()
- Specified by:
getLicensesin interfaceExtension- Returns:
- the license of the extension, an empty collection if there is none
-
getSummary
public String getSummary()
- Specified by:
getSummaryin interfaceExtension- Returns:
- a short description of the extension
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceExtension- Returns:
- a description of the extension
-
getWebSite
public String getWebSite()
- Specified by:
getWebSitein interfaceExtension- Returns:
- an URL for the extension website
-
getAuthors
public Collection<ExtensionAuthor> getAuthors()
- Specified by:
getAuthorsin interfaceExtension- Returns:
- the extension authors, an empty collection if there is none
-
getComponents
public Collection<ExtensionComponent> getComponents()
- Specified by:
getComponentsin interfaceExtension- Returns:
- the XWiki components provided by the extension
-
getAllowedNamespaces
public Collection<String> getAllowedNamespaces()
- Specified by:
getAllowedNamespacesin interfaceExtension- Returns:
- the namespaces where it's allowed to install this extension
-
getDependencies
public Collection<ExtensionDependency> getDependencies()
- Specified by:
getDependenciesin interfaceExtension- Returns:
- the dependencies of the extension, an empty collection if there is none
-
getManagedDependencies
public Collection<ExtensionDependency> getManagedDependencies()
Description copied from interface:ExtensionManaged dependencies are used to override transitive dependencies (usually the version of this transitive dependency).- Specified by:
getManagedDependenciesin interfaceExtension- Returns:
- the managed dependencies, empty list if there is none
-
getFile
public ExtensionFile getFile()
Description copied from interface:ExtensionAccess the associated extension file content.
-
getRepository
public ExtensionRepository getRepository()
- Specified by:
getRepositoryin interfaceExtension- Returns:
- the repository of the extension
-
getScm
public ExtensionScm getScm()
-
getIssueManagement
public ExtensionIssueManagement getIssueManagement()
- Specified by:
getIssueManagementin interfaceExtension- Returns:
- informations related to extension's issues management
-
getCategory
public String getCategory()
- Specified by:
getCategoryin interfaceExtension- Returns:
- the category of the extension
-
getRepositories
public Collection<ExtensionRepositoryDescriptor> getRepositories()
- Specified by:
getRepositoriesin interfaceExtension- Returns:
- the custom repositories provided by the extension (usually to resolve dependencies)
-
getProperties
public Map<String,Object> getProperties()
Description copied from interface:ExtensionExtendsExtensionstandard properties.Theses are generally provided by specific repositories. For example a maven repository will provide group and artifacts ids.
- Specified by:
getPropertiesin interfaceExtension- Returns:
- the properties
-
getProperty
public <T> T getProperty(String key)
- Specified by:
getPropertyin interfaceExtension- 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:ExtensionGet a property.- Specified by:
getPropertyin interfaceExtension- Type Parameters:
T- type of the property value- Parameters:
key- the property keydef- the value to return if no property is associated to the provided key- Returns:
- the property value or
defaultof the property is not found - See Also:
Extension.getProperty(String)
-
compareTo
public int compareTo(Extension o)
- Specified by:
compareToin interfaceComparable<E extends Extension>
-
-