public interface MultiModuleGroupQuery
"classes"
). The default SourceGroup
presentation
(display name) includes module information, so the user can identify individual package root
folders. In some cases, different presentation, or more precise information on
relationship between a SourceGroup and module is needed. Such information can be obtained
using MultiModuleGroupQuery
.
The object can be obtained from project Lookup. If it is not present, the project does not support java modules.
If the source level of the project is 8 or less, the MultiModuleGroupQuery
may be present,
but will return null
on all queries, as modules are not supported before JDK9.
Modifier and Type | Interface and Description |
---|---|
static class |
MultiModuleGroupQuery.Result
Describes properties of a
SourceGroup related to modular
structure of the project. |
Modifier and Type | Method and Description |
---|---|
SourceGroup[] |
filterModuleGroups(String modName,
SourceGroup[] groups)
Determines which
SourceGroup s are owned by a particular module. |
MultiModuleGroupQuery.Result |
findModuleInfo(SourceGroup grp)
Obtains module-related information for the passed
SourceGroup . |
@CheckForNull MultiModuleGroupQuery.Result findModuleInfo(@NonNull SourceGroup grp)
SourceGroup
.
Returns null
, if SourceGroup
is not known, is not owned by any module, or language
level for the project does not support modules.grp
- not null, the SourceGroup
instancenull
@NonNull SourceGroup[] filterModuleGroups(@NonNull String modName, @NonNull SourceGroup[] groups)
SourceGroup
s are owned by a particular module.
Returns SourceGroup
s contained within the module, empty array
if module does not exist or does not contain any of the passed SourceGroups
.modName
- module namegroups
- groups, to filter.