public abstract class AbstractExtensionDependency extends Object implements ExtensionDependency
ExtensionDependency
implementations.Modifier and Type | Field and Description |
---|---|
protected List<ExtensionPattern> |
exclusions |
protected String |
id |
protected boolean |
optional |
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,
boolean optional) |
AbstractExtensionDependency(String id,
VersionConstraint versionConstraint,
boolean optional,
Map<String,Object> properties) |
AbstractExtensionDependency(String id,
VersionConstraint versionConstraint,
Map<String,Object> properties) |
Modifier and Type | Method and Description |
---|---|
void |
addExclusion(ExtensionPattern exclusion) |
void |
addRepository(ExtensionRepositoryDescriptor repository)
Add a new repository to the extension.
|
boolean |
equals(Object obj) |
Collection<ExtensionPattern> |
getExclusions() |
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.
|
boolean |
isOptional() |
void |
putProperty(String key,
Object value)
Set a property.
|
void |
setExclusions(Collection<? extends ExtensionPattern> exclusions) |
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<ExtensionPattern> exclusions
getExclusions()
protected List<ExtensionRepositoryDescriptor> repositories
getRepositories()
protected boolean optional
isOptional()
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, boolean optional)
id
- the id (or feature) of the extension dependencyversionConstraint
- the version constraint of the extension dependencyoptional
- true if the dependency is optionalpublic 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 AbstractExtensionDependency(String id, VersionConstraint versionConstraint, boolean optional, Map<String,Object> properties)
id
- the id (or feature) of the extension dependencyversionConstraint
- the version constraint of the extension dependencyoptional
- true if the dependency is optionalproperties
- the custom properties of the extension dependencypublic String getId()
getId
in interface ExtensionDependency
public VersionConstraint getVersionConstraint()
getVersionConstraint
in interface ExtensionDependency
public void setVersionConstraint(VersionConstraint versionConstraint)
versionConstraint
- the version constraint of the target extensionpublic Collection<ExtensionPattern> getExclusions()
getExclusions
in interface ExtensionDependency
@Unstable public void setExclusions(Collection<? extends ExtensionPattern> exclusions)
exclusions
- the exclusions patterns to apply to transitive dependencies@Unstable public void addExclusion(ExtensionPattern exclusion)
exclusion
- an exclusion pattern to apply to transitive dependenciespublic Collection<ExtensionRepositoryDescriptor> getRepositories()
getRepositories
in interface ExtensionDependency
public 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 isOptional()
isOptional
in interface ExtensionDependency
public boolean isCompatible(Extension extension)
ExtensionDependency
isCompatible
in interface ExtensionDependency
extension
- the extension to checkpublic boolean isCompatible(ExtensionId extensionId)
ExtensionDependency
isCompatible
in interface ExtensionDependency
extensionId
- the extension to checkpublic Map<String,Object> getProperties()
ExtensionDependency
ExtensionDependency
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 ExtensionDependency
public Object getProperty(String key)
getProperty
in interface ExtensionDependency
key
- 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)
ExtensionDependency
getProperty
in interface ExtensionDependency
T
- 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–2021 XWiki. All rights reserved.