public abstract static class ConflictResolver.OptionalitySelector extends Object
ConflictResolver
that determines the effective optional flag of a dependency from a
potentially conflicting set of derived optionalities. The optionality selector gets invoked after the
ConflictResolver.VersionSelector
has picked the winning node.
Note: Implementations must be stateless.
Constructor and Description |
---|
ConflictResolver.OptionalitySelector() |
Modifier and Type | Method and Description |
---|---|
ConflictResolver.OptionalitySelector |
getInstance(org.eclipse.aether.graph.DependencyNode root,
org.eclipse.aether.collection.DependencyGraphTransformationContext context)
Retrieves the optionality selector for use during the specified graph transformation.
|
abstract void |
selectOptionality(ConflictResolver.ConflictContext context)
Determines the effective optional flag of the dependency given by
ConflictResolver.ConflictContext.getWinner() . |
public ConflictResolver.OptionalitySelector()
public ConflictResolver.OptionalitySelector getInstance(org.eclipse.aether.graph.DependencyNode root, org.eclipse.aether.collection.DependencyGraphTransformationContext context) throws org.eclipse.aether.RepositoryException
ConflictResolver.transformGraph(DependencyNode, DependencyGraphTransformationContext)
invocation to
allow implementations to prepare any auxiliary data that is needed for their operation. Given that
implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The
default implementation simply returns the current instance which is appropriate for implementations which do
not require auxiliary data.root
- The root node of the (possibly cyclic!) graph to transform, must not be null
.context
- The graph transformation context, must not be null
.null
.org.eclipse.aether.RepositoryException
- If the instance could not be retrieved.public abstract void selectOptionality(ConflictResolver.ConflictContext context) throws org.eclipse.aether.RepositoryException
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.context
- The conflict context, must not be null
.org.eclipse.aether.RepositoryException
- If the optionality selection failed.Copyright © 2010–2018 The Apache Software Foundation. All rights reserved.