org.eclipse.aether.util.graph.transformer

## Class SimpleOptionalitySelector

- java.lang.Object
- - org.eclipse.aether.util.graph.transformer.ConflictResolver.OptionalitySelector
  - - org.eclipse.aether.util.graph.transformer.SimpleOptionalitySelector

-     public final class SimpleOptionalitySelector
      extends ConflictResolver.OptionalitySelector

  An optionality selector for use with `ConflictResolver`. In general, this selector only marks a dependency as optional if all its occurrences are optional. If however a direct dependency is involved, its optional flag is selected.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleOptionalitySelector()` Creates a new instance of this optionality selector.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `selectOptionality(ConflictResolver.ConflictContext context)` Determines the effective optional flag of the dependency given by `ConflictResolver.ConflictContext.getWinner()`.

    - ### Methods inherited from class org.eclipse.aether.util.graph.transformer.ConflictResolver.OptionalitySelector

      `getInstance`

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

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

- - ### Constructor Detail

    - #### SimpleOptionalitySelector

          public SimpleOptionalitySelector()

      Creates a new instance of this optionality selector.

  - ### Method Detail

    - #### selectOptionality

          public void selectOptionality(ConflictResolver.ConflictContext context)
                                 throws RepositoryException

      Description copied from class: `ConflictResolver.OptionalitySelector`
      Determines the effective optional flag of the dependency given by `ConflictResolver.ConflictContext.getWinner()`. Implementations will usually iterate `ConflictResolver.ConflictContext.getItems()`, inspect `ConflictResolver.ConflictItem.getOptionalities()` and eventually call `ConflictResolver.ConflictContext.setOptional(Boolean)` to deliver the effective optional flag.
      Specified by:
        `selectOptionality` in class `ConflictResolver.OptionalitySelector`
      Parameters:
        `context` - The conflict context, must not be `null`.
      Throws:
        `RepositoryException` - If the optionality selection failed.

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