Interface CodeContribution
- All Superinterfaces:
Resource
- All Known Subinterfaces:
AppJarFile, ClasspathElement, ClassTree, JavaResourceTree, LibraryJarFile, ModulePathElement, MvnRepoLibraryJarFile
- All Known Implementing Classes:
DefaultClassTree, DefaultJavaResourceTree, DefaultLibraryJarFile, DefaultMvnRepoLibraryJarFile
Common base interface for resources that can be used in either a
classpath or a module-path.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanChecks whether this code contribution is modular.static booleanisModular(CodeContribution contribution) Checks whether the code contribution is modular.Returns the module name if this element is a named module.toPath()Return the representation of the element as it must appear on a classpath or module-path.Methods inherited from interface Resource
asOf, asOfLocalized, cleanup, isNewerThan, name, type
-
Method Details
-
toPath
-
isModular
Checks whether the code contribution is modular. This works for both JAR files and directories. Both are considered as modular if they contain a
module-info.class. JARs are also considered as modular if they have anAutomatic-Module-Nameset in theirMANIFEST.MF.This is provided as static method in order to simplify reuse in classes implementing this interface.
- Parameters:
contribution- the contribution- Returns:
- true, if the contribution is modular
-
isModular
Checks whether this code contribution is modular. This works for both JAR files and directories. Both are considered as modular if they contain amodule-info.class. JARs are also considered as modular if they have anAutomatic-Module-Nameset in theirMANIFEST.MF.- Returns:
- true, if the contribution is modular
-
moduleName
Returns the module name if this element is a named module.- Returns:
- the optional module name
-