public abstract class AbstractExtensionDependency extends Object implements ExtensionDependency
ExtensionDependency implementations.| Modifier and Type | Field and Description |
|---|---|
protected String |
id |
protected Map<String,Object> |
properties |
protected List<ExtensionRepositoryDescriptor> |
repositories |
protected VersionConstraint |
versionConstraint |
| Constructor and Description |
|---|
AbstractExtensionDependency(ExtensionDependency dependency)
Create new instance by cloning the provided one.
|
AbstractExtensionDependency(ExtensionDependency dependency,
VersionConstraint versionConstraint)
Create new instance by cloning the provided one with different version constraint.
|
AbstractExtensionDependency(String id,
VersionConstraint versionConstraint) |
AbstractExtensionDependency(String id,
VersionConstraint versionConstraint,
Map<String,Object> properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRepository(ExtensionRepositoryDescriptor repository)
Add a new repository to the extension.
|
boolean |
equals(Object obj) |
String |
getId() |
Map<String,Object> |
getProperties()
Extends
ExtensionDependency standard properties. |
Object |
getProperty(String key) |
<T> T |
getProperty(String key,
T def)
Get a property.
|
Collection<ExtensionRepositoryDescriptor> |
getRepositories() |
VersionConstraint |
getVersionConstraint() |
int |
hashCode() |
boolean |
isCompatible(Extension extension)
Indicate if the passed extension is compatible with this dependency.
|
boolean |
isCompatible(ExtensionId extensionId)
Indicate if the passed extension id is compatible with this dependency.
|
void |
putProperty(String key,
Object value)
Set a property.
|
void |
setId(String id) |
void |
setProperties(Map<String,Object> properties)
Replace existing properties with provided properties.
|
void |
setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories) |
void |
setVersionConstraint(VersionConstraint versionConstraint) |
String |
toString() |
protected VersionConstraint versionConstraint
getVersionConstraint()protected List<ExtensionRepositoryDescriptor> repositories
getRepositories()protected Map<String,Object> properties
getProperties()public AbstractExtensionDependency(ExtensionDependency dependency)
dependency - the extension dependency to copypublic AbstractExtensionDependency(ExtensionDependency dependency, VersionConstraint versionConstraint)
dependency - the extension dependency to copyversionConstraint - the version constraint to setpublic AbstractExtensionDependency(String id, VersionConstraint versionConstraint)
id - the id (or feature) of the extension dependencyversionConstraint - the version constraint of the extension dependencypublic AbstractExtensionDependency(String id, VersionConstraint versionConstraint, Map<String,Object> properties)
id - the id (or feature) of the extension dependencyversionConstraint - the version constraint of the extension dependencyproperties - the custom properties of the extension dependencypublic String getId()
getId in interface ExtensionDependencypublic VersionConstraint getVersionConstraint()
getVersionConstraint in interface ExtensionDependencypublic void setVersionConstraint(VersionConstraint versionConstraint)
versionConstraint - the version constraint of the target extensionpublic Collection<ExtensionRepositoryDescriptor> getRepositories()
getRepositories in interface ExtensionDependencypublic void setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories)
repositories - the custom repositories provided by the extension (usually to resolve dependencies)public void addRepository(ExtensionRepositoryDescriptor repository)
repository - a repository descriptorpublic boolean isCompatible(Extension extension)
ExtensionDependencyisCompatible in interface ExtensionDependencyextension - the extension to checkpublic boolean isCompatible(ExtensionId extensionId)
ExtensionDependencyisCompatible in interface ExtensionDependencyextensionId - the extension to checkpublic Map<String,Object> getProperties()
ExtensionDependencyExtensionDependency standard properties.
Theses are generally provided by specific repositories. For example a AETHER repository will provide AETHER Dependency representation to avoid conversion when searching for the dependency on a AETHER based repository.
getProperties in interface ExtensionDependencypublic Object getProperty(String key)
getProperty in interface ExtensionDependencykey - the property keypublic void putProperty(String key, Object value)
key - the property keyvalue - the property valuegetProperty(String)public void setProperties(Map<String,Object> properties)
properties - the propertiespublic <T> T getProperty(String key, T def)
ExtensionDependencygetProperty in interface ExtensionDependencyT - 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 foundExtensionDependency.getProperty(String)Copyright © 2004–2017 XWiki. All rights reserved.