public interface TraversalStrategies extends Serializable, Cloneable, Iterable<TraversalStrategy<?>>
Traversal
maintains a set of TraversalStrategy
instances within a TraversalStrategies object.
TraversalStrategies are responsible for compiling a traversal prior to its execution.Modifier and Type | Interface and Description |
---|---|
static class |
TraversalStrategies.GlobalCache |
Modifier and Type | Field and Description |
---|---|
static List<Class<? extends TraversalStrategy>> |
STRATEGY_CATEGORIES |
Modifier and Type | Method and Description |
---|---|
TraversalStrategies |
addStrategies(TraversalStrategy<?>... strategies)
Add all the provided
TraversalStrategy instances to the current collection. |
TraversalStrategies |
clone() |
default <T extends TraversalStrategy> |
getStrategy(Class<T> traversalStrategyClass)
Return the
TraversalStrategy instance associated with the provided class. |
Iterator<TraversalStrategy<?>> |
iterator()
Return an
Iterator of the TraversalStrategy instances. |
TraversalStrategies |
removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
Remove all the provided
TraversalStrategy classes from the current collection. |
static Set<TraversalStrategy<?>> |
sortStrategies(Set<TraversalStrategy<?>> strategies)
Sorts the list of provided strategies such that the
TraversalStrategy.applyPost()
and TraversalStrategy.applyPrior() dependencies are respected. |
default List<TraversalStrategy<?>> |
toList()
Return an immutable list of the
TraversalStrategy instances. |
static void |
visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap,
List<Class<? extends TraversalStrategy>> sortedStrategyClasses,
Set<Class<? extends TraversalStrategy>> seenStrategyClases,
List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses,
Class<? extends TraversalStrategy> strategyClass) |
forEach, spliterator
static final List<Class<? extends TraversalStrategy>> STRATEGY_CATEGORIES
default List<TraversalStrategy<?>> toList()
TraversalStrategy
instances.Iterator<TraversalStrategy<?>> iterator()
Iterator
of the TraversalStrategy
instances.iterator
in interface Iterable<TraversalStrategy<?>>
default <T extends TraversalStrategy> Optional<T> getStrategy(Class<T> traversalStrategyClass)
TraversalStrategy
instance associated with the provided class.T
- the strategy class typetraversalStrategyClass
- the class of the strategy to getTraversalStrategies addStrategies(TraversalStrategy<?>... strategies)
TraversalStrategy
instances to the current collection. When all the provided
strategies have been added, the collection is resorted. If a strategy class is found to already be defined, it
is removed and replaced by the newly added one.strategies
- the traversal strategies to addTraversalStrategies removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
TraversalStrategy
classes from the current collection.
When all the provided strategies have been removed, the collection is resorted.strategyClasses
- the traversal strategies to remove by their classTraversalStrategies clone()
static Set<TraversalStrategy<?>> sortStrategies(Set<TraversalStrategy<?>> strategies)
TraversalStrategy.applyPost()
and TraversalStrategy.applyPrior()
dependencies are respected.
Note, that the order may not be unique.strategies
- the traversal strategies to sortstatic void visit(Map<Class<? extends TraversalStrategy>,Set<Class<? extends TraversalStrategy>>> dependencyMap, List<Class<? extends TraversalStrategy>> sortedStrategyClasses, Set<Class<? extends TraversalStrategy>> seenStrategyClases, List<Class<? extends TraversalStrategy>> unprocessedStrategyClasses, Class<? extends TraversalStrategy> strategyClass)
Copyright © 2013–2023 Apache Software Foundation. All rights reserved.