|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.extension.AbstractExtension
public abstract class AbstractExtension
Base class for Extension implementations.
| Field Summary | |
|---|---|
protected List<ExtensionAuthor> |
authors
|
protected List<ExtensionDependency> |
dependencies
|
protected String |
description
|
protected Set<String> |
features
|
protected ExtensionFile |
file
The file of the extension. |
protected ExtensionId |
id
|
protected List<ExtensionLicense> |
licenses
|
protected String |
name
|
protected Map<String,Object> |
properties
|
protected ExtensionRepository |
repository
|
protected String |
summary
|
protected String |
type
|
protected String |
website
|
| Constructor Summary | |
|---|---|
AbstractExtension(ExtensionRepository repository,
Extension extension)
Create new extension descriptor by copying provided one. |
|
AbstractExtension(ExtensionRepository repository,
ExtensionId id,
String type)
|
|
| Method Summary | ||
|---|---|---|
void |
addAuthor(ExtensionAuthor author)
Add a new author to the extension. |
|
void |
addDependency(ExtensionDependency dependency)
Add a new dependency to the extension. |
|
void |
addFeature(String feature)
Add a new feature to the extension. |
|
void |
addLicense(ExtensionLicense license)
Add a new license to the extension. |
|
boolean |
equals(Object obj)
|
|
List<ExtensionAuthor> |
getAuthors()
|
|
List<? 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)
|
|
|
getProperty(String key,
T def)
Get a property. |
|
ExtensionRepository |
getRepository()
|
|
String |
getSummary()
|
|
String |
getType()
|
|
String |
getWebSite()
|
|
int |
hashCode()
|
|
void |
putProperty(String key,
Object value)
Set a property. |
|
protected void |
set(Extension extension)
Update optional informations based on the provided extension. |
|
void |
setAuthors(Collection<ExtensionAuthor> authors)
|
|
void |
setDependencies(Collection<? extends ExtensionDependency> dependencies)
|
|
void |
setDescription(String description)
|
|
void |
setFeatures(Collection<String> features)
|
|
protected void |
setFile(ExtensionFile file)
|
|
protected void |
setId(ExtensionId id)
|
|
void |
setLicenses(Collection<ExtensionLicense> licenses)
|
|
void |
setName(String name)
|
|
void |
setProperties(Map<String,Object> properties)
Replace existing properties with provided properties. |
|
protected void |
setRepository(ExtensionRepository repository)
|
|
void |
setSummary(String summary)
|
|
protected void |
setType(String type)
|
|
void |
setWebsite(String website)
|
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ExtensionId id
getId()protected Set<String> features
getFeatures()protected String type
getType()protected String name
getName()protected List<ExtensionLicense> licenses
getLicenses()protected String summary
getSummary()protected String description
getDescription()protected List<ExtensionAuthor> authors
getAuthors()protected String website
getWebSite()protected ExtensionRepository repository
getRepository()protected Map<String,Object> properties
getProperties()protected List<ExtensionDependency> dependencies
getDependencies()protected ExtensionFile file
| Constructor Detail |
|---|
public AbstractExtension(ExtensionRepository repository,
ExtensionId id,
String type)
repository - the repository where this extension comes fromid - the extension identifiertype - the extension type
public AbstractExtension(ExtensionRepository repository,
Extension extension)
repository - the repository where this extension comes fromextension - the extension to copy| Method Detail |
|---|
protected void set(Extension extension)
extension - the extension from which to get informationspublic ExtensionId getId()
getId in interface Extensionprotected void setId(ExtensionId id)
id - the extension idgetId()public Collection<String> getFeatures()
Extension
getFeatures in interface Extensionpublic void setFeatures(Collection<String> features)
features - the extension ids also provided by this extensionpublic void addFeature(String feature)
feature - a feature namepublic String getType()
getType in interface Extensionprotected void setType(String type)
type - the type of the extensiongetType()public String getName()
getName in interface Extensionpublic void setName(String name)
name - the display name of the extensionpublic Collection<ExtensionLicense> getLicenses()
getLicenses in interface Extensionpublic void setLicenses(Collection<ExtensionLicense> licenses)
licenses - the licenses of the extensionpublic void addLicense(ExtensionLicense license)
license - a licensepublic String getSummary()
getSummary in interface Extensionpublic void setSummary(String summary)
summary - a short description of the extensionpublic String getDescription()
getDescription in interface Extensionpublic void setDescription(String description)
description - a description of the extensionpublic List<ExtensionAuthor> getAuthors()
getAuthors in interface Extensionpublic void setAuthors(Collection<ExtensionAuthor> authors)
authors - the authors of the extensionpublic void addAuthor(ExtensionAuthor author)
author - an authorpublic String getWebSite()
getWebSite in interface Extensionpublic void setWebsite(String website)
website - an URL for the extension websitepublic void addDependency(ExtensionDependency dependency)
dependency - a dependencypublic List<? extends ExtensionDependency> getDependencies()
getDependencies in interface Extensionpublic void setDependencies(Collection<? extends ExtensionDependency> dependencies)
dependencies - the dependencies of the extensiongetDependencies()public ExtensionRepository getRepository()
getRepository in interface Extensionprotected void setRepository(ExtensionRepository repository)
repository - the repository of the extensiongetRepository()public ExtensionFile getFile()
Extension
getFile in interface Extensionprotected void setFile(ExtensionFile file)
file - the file of the extensionpublic 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 Object getProperty(String key)
getProperty in interface Extensionkey - the property key
public <T> T getProperty(String key,
T def)
Extension
getProperty in interface ExtensionT - type of the property valuekey - the property keydef - the value to return if no property is associated to the provided key
default of the property is not foundExtension.getProperty(String)
public void putProperty(String key,
Object value)
key - the property keyvalue - the property valuegetProperty(String)public void setProperties(Map<String,Object> properties)
properties - the propertiespublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||