Class MappingsCompletionManager
hypo-model
and hypo-hydrate
with mappings analysis using
change contributors
.
Classes which implement ChangeContributor
run on ClassData
in a HypoContext
along with the
current MappingSet
and submit changes to make to the current MappingSet
via the
ChangeRegistry
. This class, the manager, handles the orchestration of each of these steps. This class does
assume the HypoContext
has already been hydrated before it's passed in to the
create()
method.
Due to the limitations ChangeRegistry
has in terms of dis-allowing multiple changes from targeting the
same class or member mapping, ChangeChain
can be used to chain together sets of changes to be run serially
rather than in parallel. It's generally recommended to only run compatible
change contributors
in parallel - compatible meaning they won't submit changes against the
same target.
- See Also:
ChangeRegistry
,ChangeChain
-
Method Summary
Modifier and TypeMethodDescriptioncompleteMappings(@NotNull MappingSet mappings, @NotNull List<@NotNull ChangeContributor> contributors)
Run completion over the givenMappingSet
using the given list ofchange contributors
.create(@NotNull HypoContext context)
Create a new instance ofMappingsCompletionManager
for the givenHypoContext
.
-
Method Details
-
create
@Contract(value="_ -> new", pure=true) @NotNull public static @NotNull MappingsCompletionManager create(@NotNull @NotNull HypoContext context)Create a new instance ofMappingsCompletionManager
for the givenHypoContext
.The given
HypoContext
is expected to have already gone through hydration.- Parameters:
context
- TheHypoContext
to use for mappings completion.- Returns:
- The new
MappingsCompletionManager
.
-
completeMappings
@NotNull public @NotNull ChangeRegistry completeMappings(@NotNull @NotNull MappingSet mappings, @NotNull @NotNull List<@NotNull ChangeContributor> contributors) throws HypoExceptionRun completion over the givenMappingSet
using the given list ofchange contributors
. This will return aChangeRegistry
which has all of the changes submitted from the givenchange contributors
ready to apply withChangeRegistry.applyChanges(MappingSet)
.- Parameters:
mappings
- TheMappingSet
to complete.contributors
- Thechange contributors
to run against the mappings.- Returns:
- A
ChangeRegistry
filled in with the changes submitted by the given contributors. - Throws:
HypoException
- If one of thechange contributors
fails.
-