Class AncestorOrSelfDependencyNodeFilter
- java.lang.Object
-
- org.apache.maven.shared.dependency.graph.filter.AncestorOrSelfDependencyNodeFilter
-
- All Implemented Interfaces:
DependencyNodeFilter
public class AncestorOrSelfDependencyNodeFilter extends java.lang.Object implements DependencyNodeFilter
A dependency node filter than only accepts nodes that are ancestors of, or equal to, a given list of nodes.- Since:
- 1.1
- Version:
- $Id: AncestorOrSelfDependencyNodeFilter.java 1684260 2015-06-08 19:57:54Z rfscholte $
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<DependencyNode>
descendantNodes
The list of nodes that this filter accepts ancestors-or-self of.
-
Constructor Summary
Constructors Constructor Description AncestorOrSelfDependencyNodeFilter(java.util.List<DependencyNode> descendantNodes)
Creates a dependency node filter that only accepts nodes that are ancestors of, or equal to, the specified list of nodes.AncestorOrSelfDependencyNodeFilter(DependencyNode descendantNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(DependencyNode node)
Gets whether this filter accepts the specified dependency node.private boolean
isAncestorOrSelf(DependencyNode ancestorNode, DependencyNode descendantNode)
Gets whether the first dependency node is an ancestor-or-self of the second.
-
-
-
Field Detail
-
descendantNodes
private final java.util.List<DependencyNode> descendantNodes
The list of nodes that this filter accepts ancestors-or-self of.
-
-
Constructor Detail
-
AncestorOrSelfDependencyNodeFilter
public AncestorOrSelfDependencyNodeFilter(DependencyNode descendantNode)
-
AncestorOrSelfDependencyNodeFilter
public AncestorOrSelfDependencyNodeFilter(java.util.List<DependencyNode> descendantNodes)
Creates a dependency node filter that only accepts nodes that are ancestors of, or equal to, the specified list of nodes.- Parameters:
descendantNodes
- the list of nodes to accept ancestors-or-self of
-
-
Method Detail
-
accept
public boolean accept(DependencyNode node)
Gets whether this filter accepts the specified dependency node.- Specified by:
accept
in interfaceDependencyNodeFilter
- Parameters:
node
- the dependency node to check- Returns:
true
if this filter accepts the specified dependency node
-
isAncestorOrSelf
private boolean isAncestorOrSelf(DependencyNode ancestorNode, DependencyNode descendantNode)
Gets whether the first dependency node is an ancestor-or-self of the second.- Parameters:
ancestorNode
- the ancestor-or-self dependency nodedescendantNode
- the dependency node to test- Returns:
true
ifancestorNode
is an ancestor, or equal to,descendantNode
-
-