Class DependencyUtil
- java.lang.Object
- 
- org.apache.jackrabbit.vault.packaging.DependencyUtil
 
- 
 public class DependencyUtil extends Object Dependency Utilities
- 
- 
Constructor SummaryConstructors Constructor Description DependencyUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static Dependency[]add(@NotNull Dependency[] deps, @NotNull Dependency dep)Adds an dependency to the give package if it is not already contained in the given list. version ranges are current ignored.static Dependency[]addExact(@NotNull Dependency[] deps, @NotNull PackageId id)Adds an exact dependency to the give package if it is not already contained in the given list.static booleanmatches(@NotNull Dependency[] deps, @NotNull PackageId id)Checks if any of the dependencies matches the given idstatic List<PackageId>resolve(Map<PackageId,Dependency[]> list)Resolves a list of resolutions respecting their internal dependency references.static <T extends VaultPackage>
 voidsort(Collection<T> packages)Sorts the packages by the dependency orderstatic <T extends JcrPackage>
 voidsortPackages(Collection<T> packages)Sorts the packages by the dependency order
 
- 
- 
- 
Method Detail- 
sortpublic static <T extends VaultPackage> void sort(Collection<T> packages) throws CyclicDependencyException Sorts the packages by the dependency order- Type Parameters:
- T- Type of the collection.
- Parameters:
- packages- packages to sort
- Throws:
- CyclicDependencyException- if a cyclic dependency is detected
 
 - 
sortPackagespublic static <T extends JcrPackage> void sortPackages(Collection<T> packages) throws CyclicDependencyException, RepositoryException Sorts the packages by the dependency order- Type Parameters:
- T- Type of the collection.
- Parameters:
- packages- packages to sort
- Throws:
- CyclicDependencyException- if a cyclic dependency is detected
- RepositoryException- if an repository error occurs
 
 - 
resolvepublic static List<PackageId> resolve(Map<PackageId,Dependency[]> list) throws CyclicDependencyException Resolves a list of resolutions respecting their internal dependency references.- Parameters:
- list- list of resolutions
- Returns:
- a new list of resolutions
- Throws:
- CyclicDependencyException- if a cyclic dependency is detected
 
 - 
matchespublic static boolean matches(@NotNull @NotNull Dependency[] deps, @NotNull @NotNull PackageId id)Checks if any of the dependencies matches the given id- Parameters:
- deps- the list of dependencies
- id- the id
- Returns:
- trueif matches
 
 - 
addExactpublic static Dependency[] addExact(@NotNull @NotNull Dependency[] deps, @NotNull @NotNull PackageId id) Adds an exact dependency to the give package if it is not already contained in the given list.- Parameters:
- deps- the original dependencies
- id- the id to add
- Returns:
- the new array of dependencies, or depsif nothing changed.
 
 - 
addpublic static Dependency[] add(@NotNull @NotNull Dependency[] deps, @NotNull @NotNull Dependency dep) Adds an dependency to the give package if it is not already contained in the given list. version ranges are current ignored.- Parameters:
- deps- the original dependencies
- dep- the dependency to add
- Returns:
- the new array of dependencies, or depsif nothing changed.
 
 
- 
 
-