Package org.apache.ivy.core.sort
Class ModuleDescriptorSorter
java.lang.Object
org.apache.ivy.core.sort.ModuleDescriptorSorter
Inner helper class for sorting ModuleDescriptors.
ModuleDescriptorSorter use CollectionOfModulesToSort to find the dependencies of the modules, and use ModuleInSort to store some temporary values attached to the modules to sort.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CircularDependencyStrategy
private final CollectionOfModulesToSort
private final List<ModuleDescriptor>
-
Constructor Summary
ConstructorsConstructorDescriptionModuleDescriptorSorter
(Collection<ModuleDescriptor> modulesDescriptorsToSort, VersionMatcher matcher, NonMatchingVersionReporter nonMatchingVersionReporter, CircularDependencyStrategy circularDepStrategy) -
Method Summary
Modifier and TypeMethodDescriptionIterates over all modules calling sortModuleDescriptorsHelp.private void
sortModuleDescriptorsHelp
(ModuleInSort current, ModuleInSort caller) If current module has already been added to list, returns, Otherwise invokes sortModuleDescriptorsHelp for all dependencies contained within set of moduleDescriptors.
-
Field Details
-
moduleDescriptors
-
sorted
-
circularDepStrategy
-
-
Constructor Details
-
ModuleDescriptorSorter
public ModuleDescriptorSorter(Collection<ModuleDescriptor> modulesDescriptorsToSort, VersionMatcher matcher, NonMatchingVersionReporter nonMatchingVersionReporter, CircularDependencyStrategy circularDepStrategy)
-
-
Method Details
-
sortModuleDescriptors
Iterates over all modules calling sortModuleDescriptorsHelp.- Returns:
- sorted module
- Throws:
CircularDependencyException
- somehow
-
sortModuleDescriptorsHelp
private void sortModuleDescriptorsHelp(ModuleInSort current, ModuleInSort caller) throws CircularDependencyException If current module has already been added to list, returns, Otherwise invokes sortModuleDescriptorsHelp for all dependencies contained within set of moduleDescriptors. Then finally adds self to list of sorted.
When a loop is detected by a recursive call, the moduleDescriptors are not added immediately added to the sorted list. They are added as loop dependencies of the root, and will be added to the sorted list only when the root itself will be added.- Parameters:
current
- Current module to add to sorted list.- Throws:
CircularDependencyException
- somehow
-