org.eclipse.aether.util.graph.version

## Class ContextualSnapshotVersionFilter

- java.lang.Object
- - org.eclipse.aether.util.graph.version.ContextualSnapshotVersionFilter

- All Implemented Interfaces:
    VersionFilter

      public final class ContextualSnapshotVersionFilter
      extends Object
      implements VersionFilter

  A version filter that blocks "*-SNAPSHOT" versions if the `root artifact` of the dependency graph is not a snapshot. Alternatively, this filter can be forced to always ban snapshot versions by setting the boolean `configuration property` `CONFIG_PROP_ENABLE` to `true`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.aether.collection.VersionFilter

      `VersionFilter.VersionFilterContext`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONFIG_PROP_ENABLE` The key in the repository session's `configuration properties` used to store a `Boolean` flag whether this filter should be forced to ban snapshots.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContextualSnapshotVersionFilter()` Creates a new instance of this version filter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `VersionFilter` | `deriveChildFilter(DependencyCollectionContext context)` Derives a version filter for the specified collection context.
    `boolean` | `equals(Object obj)`
    `void` | `filterVersions(VersionFilter.VersionFilterContext context)` Filters the available versions for a given dependency.
    `int` | `hashCode()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONFIG_PROP_ENABLE

          public static final String CONFIG_PROP_ENABLE

      The key in the repository session's `configuration properties` used to store a `Boolean` flag whether this filter should be forced to ban snapshots. By default, snapshots are only filtered if the root artifact is not a snapshot.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ContextualSnapshotVersionFilter

          public ContextualSnapshotVersionFilter()

      Creates a new instance of this version filter.

  - ### Method Detail

    - #### filterVersions

          public void filterVersions(VersionFilter.VersionFilterContext context)

      Description copied from interface: `VersionFilter`
      Filters the available versions for a given dependency. Implementations will usually call `context.iterator()` to inspect the available versions and use `Iterator.remove()` to delete unacceptable versions. If no versions remain after all filtering has been performed, the dependency collection process will automatically fail, i.e. implementations need not handle this situation on their own.
      Specified by:
        `filterVersions` in interface `VersionFilter`
      Parameters:
        `context` - The version filter context, must not be `null`.

    - #### deriveChildFilter

          public VersionFilter deriveChildFilter(DependencyCollectionContext context)

      Description copied from interface: `VersionFilter`
      Derives a version filter for the specified collection context. The derived filter will be used to handle version ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
      Specified by:
        `deriveChildFilter` in interface `VersionFilter`
      Parameters:
        `context` - The dependency collection context, must not be `null`.
      Returns:
        The version filter for the target node or `null` if versions should not be filtered any more.

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2010-2013 The Eclipse Foundation. All Rights Reserved.