Class AbstractExtensionDependency

    • Constructor Detail

      • AbstractExtensionDependency

        public AbstractExtensionDependency​(ExtensionDependency dependency)
        Create new instance by cloning the provided one.
        Parameters:
        dependency - the extension dependency to copy
        Since:
        7.3M1
      • AbstractExtensionDependency

        public AbstractExtensionDependency​(ExtensionDependency dependency,
                                           VersionConstraint versionConstraint)
        Create new instance by cloning the provided one with different version constraint.
        Parameters:
        dependency - the extension dependency to copy
        versionConstraint - the version constraint to set
      • AbstractExtensionDependency

        public AbstractExtensionDependency​(String id,
                                           VersionConstraint versionConstraint)
        Parameters:
        id - the id (or feature) of the extension dependency
        versionConstraint - the version constraint of the extension dependency
      • AbstractExtensionDependency

        public AbstractExtensionDependency​(String id,
                                           VersionConstraint versionConstraint,
                                           boolean optional)
        Parameters:
        id - the id (or feature) of the extension dependency
        versionConstraint - the version constraint of the extension dependency
        optional - true if the dependency is optional
        Since:
        9.6RC1
      • AbstractExtensionDependency

        public AbstractExtensionDependency​(String id,
                                           VersionConstraint versionConstraint,
                                           Map<String,​Object> properties)
        Parameters:
        id - the id (or feature) of the extension dependency
        versionConstraint - the version constraint of the extension dependency
        properties - the custom properties of the extension dependency
      • AbstractExtensionDependency

        public AbstractExtensionDependency​(String id,
                                           VersionConstraint versionConstraint,
                                           boolean optional,
                                           Map<String,​Object> properties)
        Parameters:
        id - the id (or feature) of the extension dependency
        versionConstraint - the version constraint of the extension dependency
        optional - true if the dependency is optional
        properties - the custom properties of the extension dependency
    • Method Detail

      • setId

        public void setId​(String id)
        Parameters:
        id - the extension id
        See Also:
        getId()
      • setVersionConstraint

        public void setVersionConstraint​(VersionConstraint versionConstraint)
        Parameters:
        versionConstraint - the version constraint of the target extension
      • setExclusions

        public void setExclusions​(Collection<? extends ExtensionPattern> exclusions)
        Parameters:
        exclusions - the exclusions patterns to apply to transitive dependencies
        Since:
        12.2
      • addExclusion

        public void addExclusion​(ExtensionPattern exclusion)
        Parameters:
        exclusion - an exclusion pattern to apply to transitive dependencies
        Since:
        12.2
      • setRepositories

        public void setRepositories​(Collection<? extends ExtensionRepositoryDescriptor> repositories)
        Parameters:
        repositories - the custom repositories provided by the extension (usually to resolve dependencies)
        Since:
        7.3M1
      • addRepository

        public void addRepository​(ExtensionRepositoryDescriptor repository)
        Add a new repository to the extension.
        Parameters:
        repository - a repository descriptor
        Since:
        7.3M1
      • isOptional

        public boolean isOptional()
        Specified by:
        isOptional in interface ExtensionDependency
        Returns:
        true if the dependency is not mandatory, usually meaning it will be installed (if valid) by default but can be uninstalled without uninstalling backward dependency
      • isCompatible

        public boolean isCompatible​(Extension extension)
        Description copied from interface: ExtensionDependency
        Indicate if the passed extension is compatible with this dependency.
        Specified by:
        isCompatible in interface ExtensionDependency
        Parameters:
        extension - the extension to check
        Returns:
        true if the passed extension is compatible, false otherwise
      • isCompatible

        public boolean isCompatible​(ExtensionId extensionId)
        Description copied from interface: ExtensionDependency
        Indicate if the passed extension id is compatible with this dependency.
        Specified by:
        isCompatible in interface ExtensionDependency
        Parameters:
        extensionId - the extension to check
        Returns:
        true if the passed extension id is compatible, false otherwise
      • getProperties

        public Map<String,​Object> getProperties()
        Description copied from interface: ExtensionDependency
        Extends 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.

        Specified by:
        getProperties in interface ExtensionDependency
        Returns:
        the properties
      • putProperty

        public void putProperty​(String key,
                                Object value)
        Set a property.
        Parameters:
        key - the property key
        value - the property value
        See Also:
        getProperty(String)
      • setProperties

        public void setProperties​(Map<String,​Object> properties)
        Replace existing properties with provided properties.
        Parameters:
        properties - the properties
      • getProperty

        public <T> T getProperty​(String key,
                                 T def)
        Description copied from interface: ExtensionDependency
        Get a property.
        Specified by:
        getProperty in interface ExtensionDependency
        Type Parameters:
        T - type of the property value
        Parameters:
        key - the property key
        def - the value to return if no property is associated to the provided key
        Returns:
        the property value or default of the property is not found
        See Also:
        ExtensionDependency.getProperty(String)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object