public abstract class AbstractExtension extends Object implements MutableExtension
Extension implementations.| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
allowedNamespaces |
protected List<ExtensionAuthor> |
authors |
protected String |
category |
protected List<ExtensionDependency> |
dependencies |
protected String |
description |
protected Set<String> |
features
Deprecated.
since 8.0M1, use
featuresMap instead |
protected Map<String,ExtensionId> |
featuresMap |
protected ExtensionFile |
file
The file of the extension.
|
protected ExtensionId |
id |
protected ExtensionIssueManagement |
issueManagement |
protected List<ExtensionLicense> |
licenses |
protected List<ExtensionDependency> |
managedDependencies |
protected String |
name |
protected Map<String,Object> |
properties |
protected ReentrantLock |
propertiesLock
Used to protect properties from concurrent write;
|
protected List<ExtensionRepositoryDescriptor> |
repositories |
protected ExtensionRepository |
repository |
protected ExtensionScm |
scm |
protected String |
summary |
protected String |
type |
protected String |
website |
FIELD_ALLOWEDNAMESPACE, FIELD_ALLOWEDNAMESPACES, FIELD_AUTHOR, FIELD_AUTHORS, FIELD_CATEGORY, 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 and Description |
|---|
AbstractExtension(ExtensionRepository repository,
Extension extension)
Create new extension descriptor by copying provided one.
|
AbstractExtension(ExtensionRepository repository,
ExtensionId id,
String type) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllowedNamespace(String namespace)
Add a new allowed namespace to the extension.
|
void |
addAuthor(ExtensionAuthor author)
Add a new author to the extension.
|
void |
addDependency(ExtensionDependency dependency)
Add a new dependency to the extension.
|
void |
addExtensionFeature(ExtensionId feature)
Add a new feature to the extension.
|
void |
addFeature(String feature)
Deprecated.
|
void |
addLicense(ExtensionLicense license)
Add a new license to the extension.
|
void |
addManagedDependency(ExtensionDependency managedDependency)
Add a new managed dependency to the extension.
|
void |
addRepository(ExtensionRepositoryDescriptor repository)
Add a new repository to the extension.
|
int |
compareTo(Extension o) |
boolean |
equals(Object obj) |
<T> T |
get(String fieldName)
Get an extension field by name.
|
Collection<String> |
getAllowedNamespaces() |
List<ExtensionAuthor> |
getAuthors() |
String |
getCategory() |
List<ExtensionDependency> |
getDependencies() |
String |
getDescription() |
ExtensionId |
getExtensionFeature(String featureId)
Return the
ExtensionId object that matches the passed feature id. |
Collection<ExtensionId> |
getExtensionFeatures()
Indicate in an extension a list of provided "functionalities".
|
Collection<String> |
getFeatures()
Deprecated.
|
ExtensionFile |
getFile()
Return extension file descriptor.
|
ExtensionId |
getId() |
ExtensionIssueManagement |
getIssueManagement() |
Collection<ExtensionLicense> |
getLicenses() |
List<ExtensionDependency> |
getManagedDependencies()
Managed dependencies are used to override transitive dependencies (usually the version of this transitive
dependency).
|
String |
getName() |
Map<String,Object> |
getProperties()
Extends
Extension standard properties. |
<T> T |
getProperty(String key) |
<T> T |
getProperty(String key,
T def)
Get a property.
|
Collection<ExtensionRepositoryDescriptor> |
getRepositories() |
ExtensionRepository |
getRepository() |
ExtensionScm |
getScm() |
String |
getSummary() |
String |
getType() |
String |
getWebSite() |
int |
hashCode() |
void |
putProperty(String key,
Object value)
Set a property.
|
<T> T |
removeProperty(String key)
Remove the property associated to the passed key and return its value.
|
void |
set(Extension extension)
Update optional informations based on the provided extension.
|
void |
setAllowedNamespaces(Collection<String> namespaces) |
void |
setAuthors(Collection<? extends ExtensionAuthor> authors) |
void |
setCategory(String categrory) |
void |
setDependencies(Collection<? extends ExtensionDependency> dependencies) |
void |
setDescription(String description) |
void |
setExtensionFeatures(Collection<ExtensionId> features) |
void |
setFeatures(Collection<String> features)
Deprecated.
|
protected void |
setFile(ExtensionFile file) |
protected void |
setId(ExtensionId id) |
void |
setIssueManagement(ExtensionIssueManagement issueManagement) |
void |
setLicenses(Collection<ExtensionLicense> licenses) |
void |
setManagedDependencies(Collection<? extends ExtensionDependency> managedDependencies) |
void |
setName(String name) |
void |
setProperties(Map<String,Object> properties)
Replace existing properties with provided properties.
|
void |
setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories) |
protected void |
setRepository(ExtensionRepository repository) |
void |
setScm(ExtensionScm scm) |
void |
setSummary(String summary) |
protected void |
setType(String type) |
void |
setWebsite(String website) |
String |
toString() |
protected ExtensionId id
getId()@Deprecated protected Set<String> features
featuresMap insteadgetExtensionFeatures()protected Map<String,ExtensionId> featuresMap
getExtensionFeatures()protected List<ExtensionLicense> licenses
getLicenses()protected String summary
getSummary()protected String description
getDescription()protected List<ExtensionAuthor> authors
getAuthors()protected String website
getWebSite()protected Set<String> allowedNamespaces
getAllowedNamespaces()protected ExtensionRepository repository
getRepository()protected Map<String,Object> properties
getProperties()protected ReentrantLock propertiesLock
protected List<ExtensionDependency> dependencies
getDependencies()protected List<ExtensionDependency> managedDependencies
getManagedDependencies()protected ExtensionScm scm
getScm()protected ExtensionIssueManagement issueManagement
getIssueManagement()protected String category
getCategory()protected List<ExtensionRepositoryDescriptor> repositories
getRepositories()protected ExtensionFile file
public AbstractExtension(ExtensionRepository repository, ExtensionId id, String type)
repository - the repository where this extension comes fromid - the extension identifiertype - the extension typepublic AbstractExtension(ExtensionRepository repository, Extension extension)
repository - the repository where this extension comes fromextension - the extension to copypublic void set(Extension extension)
MutableExtensionset in interface MutableExtensionextension - the extension from which to get informationspublic <T> T get(String fieldName)
public ExtensionId getId()
protected void setId(ExtensionId id)
id - the extension idgetId()@Deprecated public Collection<String> getFeatures()
ExtensiongetFeatures in interface Extension@Deprecated public void setFeatures(Collection<String> features)
setFeatures in interface MutableExtensionfeatures - the extension ids also provided by this extension@Deprecated public void addFeature(String feature)
MutableExtensionaddFeature in interface MutableExtensionfeature - a feature namepublic Collection<ExtensionId> getExtensionFeatures()
ExtensiongetExtensionFeatures in interface ExtensionExtensionIds also provided by this extension, an empty collection if there is nonepublic ExtensionId getExtensionFeature(String featureId)
ExtensionExtensionId object that matches the passed feature id.getExtensionFeature in interface ExtensionfeatureId - the id of the featureExtensionId associated to the passed idpublic void setExtensionFeatures(Collection<ExtensionId> features)
setExtensionFeatures in interface MutableExtensionfeatures - the ExtensionIds also provided by this extensionpublic void addExtensionFeature(ExtensionId feature)
MutableExtensionaddExtensionFeature in interface MutableExtensionfeature - a feature namepublic String getType()
protected void setType(String type)
type - the type of the extensiongetType()public String getName()
public void setName(String name)
setName in interface MutableExtensionname - the display name of the extensionpublic Collection<ExtensionLicense> getLicenses()
getLicenses in interface Extensionpublic void setLicenses(Collection<ExtensionLicense> licenses)
setLicenses in interface MutableExtensionlicenses - the licenses of the extensionpublic void addLicense(ExtensionLicense license)
MutableExtensionaddLicense in interface MutableExtensionlicense - a licensepublic String getSummary()
getSummary in interface Extensionpublic void setSummary(String summary)
setSummary in interface MutableExtensionsummary - a short description of the extensionpublic String getDescription()
getDescription in interface Extensionpublic void setDescription(String description)
setDescription in interface MutableExtensiondescription - a description of the extensionpublic List<ExtensionAuthor> getAuthors()
getAuthors in interface Extensionpublic void setAuthors(Collection<? extends ExtensionAuthor> authors)
setAuthors in interface MutableExtensionauthors - the authors of the extensionpublic void addAuthor(ExtensionAuthor author)
MutableExtensionaddAuthor in interface MutableExtensionauthor - an authorpublic String getWebSite()
getWebSite in interface Extensionpublic void setWebsite(String website)
setWebsite in interface MutableExtensionwebsite - an URL for the extension websitepublic Collection<String> getAllowedNamespaces()
getAllowedNamespaces in interface Extensionpublic void addAllowedNamespace(String namespace)
MutableExtensionaddAllowedNamespace in interface MutableExtensionnamespace - a namespacepublic void setAllowedNamespaces(Collection<String> namespaces)
setAllowedNamespaces in interface MutableExtensionnamespaces - the namespaces where it's allowed to install this extensionpublic void addDependency(ExtensionDependency dependency)
MutableExtensionaddDependency in interface MutableExtensiondependency - a dependencypublic List<ExtensionDependency> getDependencies()
getDependencies in interface Extensionpublic void setDependencies(Collection<? extends ExtensionDependency> dependencies)
setDependencies in interface MutableExtensiondependencies - the dependencies of the extensionExtension.getDependencies()public void addManagedDependency(ExtensionDependency managedDependency)
MutableExtensionaddManagedDependency in interface MutableExtensionmanagedDependency - a managed dependency;public List<ExtensionDependency> getManagedDependencies()
ExtensiongetManagedDependencies in interface Extensionpublic void setManagedDependencies(Collection<? extends ExtensionDependency> managedDependencies)
setManagedDependencies in interface MutableExtensionmanagedDependencies - the managed dependencies of the extensionExtension.getManagedDependencies()public ExtensionRepository getRepository()
getRepository in interface Extensionprotected void setRepository(ExtensionRepository repository)
repository - the repository of the extensiongetRepository()public ExtensionScm getScm()
public void setScm(ExtensionScm scm)
setScm in interface MutableExtensionscm - informations related to extensions's Source Control Management;public ExtensionIssueManagement getIssueManagement()
getIssueManagement in interface Extensionpublic void setIssueManagement(ExtensionIssueManagement issueManagement)
setIssueManagement in interface MutableExtensionissueManagement - informations related to extension's issues managementpublic ExtensionFile getFile()
Extensionprotected void setFile(ExtensionFile file)
file - the file of the extensionpublic String getCategory()
getCategory in interface Extensionpublic void setCategory(String categrory)
setCategory in interface MutableExtensioncategrory - the category of the extension;public Collection<ExtensionRepositoryDescriptor> getRepositories()
getRepositories in interface Extensionpublic void setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories)
setRepositories in interface MutableExtensionrepositories - the custom repositories provided by the extension (usually to resolve dependencies)public void addRepository(ExtensionRepositoryDescriptor repository)
MutableExtensionaddRepository in interface MutableExtensionrepository - a repository descriptor;public Map<String,Object> getProperties()
ExtensionExtension standard properties.
Theses are generally provided by specific repositories. For example a maven repository will provide group and artifacts ids.
getProperties in interface Extensionpublic <T> T getProperty(String key)
getProperty in interface ExtensionT - type of the property valuekey - the property keypublic <T> T getProperty(String key, T def)
ExtensiongetProperty in interface ExtensionT - type of the property valuekey - the property keydef - the value to return if no property is associated to the provided keydefault of the property is not foundExtension.getProperty(String)public void putProperty(String key, Object value)
MutableExtensionputProperty in interface MutableExtensionkey - the property keyvalue - the property valueExtension.getProperty(String)public void setProperties(Map<String,Object> properties)
MutableExtensionsetProperties in interface MutableExtensionproperties - the propertiespublic <T> T removeProperty(String key)
MutableExtensionremoveProperty in interface MutableExtensionT - type of the property valuekey - the property keypublic int compareTo(Extension o)
compareTo in interface Comparable<Extension>Copyright © 2004–2017 XWiki. All rights reserved.