Class ModuleInfoReader
java.lang.Object
io.avaje.spi.internal.ModuleInfoReader
Helper Class to work with an application's root module-info.
Calling ModuleElement.getDirectives()
on the application module can break compilation
in some situations, so this class helps parse the module source file and get the relevant
information without breaking anything.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An exported package of a module.static class
An opened package of a module.static class
An implementation of a service provided by a module.static class
A dependency of a module.static class
A reference to a service used by a module. -
Constructor Summary
ConstructorsConstructorDescriptionParse the module-info.java using the ModuleElement from the APContext and create a new instanceModuleInfoReader
(ModuleElement moduleElement, BufferedReader reader) Parse a module-info and create a new instanceModuleInfoReader
(ModuleElement moduleElement, CharSequence moduleString) Parse a module-info and create a new instance -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsOnModulePath
(String moduleName) Check to see whether the given module is on the module path as a non-static dependencyexports()
The exports directives associated with this moduleopens()
The opens directives associated with this moduleprovides()
The provides directives associated with this modulerequires()
The requires directives associated with this moduleuses()
The uses directives associated with this modulevoid
validateServices
(String providesType, Collection<String> implementations) Checks whether the module-info has the defined provides directive and all their implementations Will register an error message compilation
-
Constructor Details
-
ModuleInfoReader
Parse the module-info.java using the ModuleElement from the APContext and create a new instance- Throws:
IOException
-
ModuleInfoReader
Parse a module-info and create a new instance- Parameters:
moduleElement
- the element representing the root modulereader
- a reader for the contents of the module-info.java- Throws:
IOException
-
ModuleInfoReader
Parse a module-info and create a new instance- Parameters:
moduleElement
- the element representing the root modulemoduleString
- a string containing the contents of the module-info.java
-
-
Method Details
-
containsOnModulePath
Check to see whether the given module is on the module path as a non-static dependency- Parameters:
moduleName
-- Returns:
- whether the given module is on the path
-
validateServices
Checks whether the module-info has the defined provides directive and all their implementations Will register an error message compilation- Parameters:
providesType
- the provides directive to checkimplementations
- the implementations to verify the presence of
-
requires
The requires directives associated with this module -
uses
The uses directives associated with this module -
exports
The exports directives associated with this module -
opens
The opens directives associated with this module -
provides
The provides directives associated with this module
-