Class PhaseDriver
java.lang.Object
com.blackbuild.klum.ast.runtime.internal.process.PhaseDriver
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPhase(PhaseAction action) static voidAssociates a newly allocated Builder with the active root lifecycle, if one exists.static voidstatic voidstatic PhaseDriver.Contextstatic KlumPhasestatic Stringstatic @NotNull PhaseDriverstatic voidleave()static voidpostPhaseApply(groovy.lang.Closure<?> closure) Registers a closure to be run directly after the current phase.voidregisterApplyLaterPhase(int phaseNumber) static voidRejects Builder-producing factory calls that are not owned by a root lifecycle.static voidrequireCurrentConstructionSession(InternalKlumBuilder<?> builder) Rejects use of a Builder from a missing, completed, or different Construction session.static voidsetCurrentMember(String member) static <T> TwithBuilderLifecycle(Supplier<? extends InternalKlumBuilder<T>> generator, Consumer<InternalKlumBuilder<T>> action) Runs one complete Builder lifecycle and returns its completed model.static <T> TwithPhaseDriver(Supplier<T> generator, Consumer<T> action)
-
Constructor Details
-
PhaseDriver
public PhaseDriver()
-
-
Method Details
-
getInstance
-
getCurrentPhase
-
getCurrentPhaseActionType
-
getContext
-
setCurrentMember
-
addPhase
-
registerApplyLaterPhase
public void registerApplyLaterPhase(int phaseNumber) -
postPhaseApply
public static void postPhaseApply(groovy.lang.Closure<?> closure) Registers a closure to be run directly after the current phase. This can be used to circumvent corner cases, where an object modifies its own containing datastructure.- Parameters:
closure- The closure to be executed after the current phase.
-
withPhaseDriver
-
withBuilderLifecycle
public static <T> T withBuilderLifecycle(Supplier<? extends InternalKlumBuilder<T>> generator, Consumer<InternalKlumBuilder<T>> action) Runs one complete Builder lifecycle and returns its completed model. -
attachToCurrentConstructionSession
Associates a newly allocated Builder with the active root lifecycle, if one exists. -
requireActiveConstructionSession
public static void requireActiveConstructionSession()Rejects Builder-producing factory calls that are not owned by a root lifecycle. -
requireCurrentConstructionSession
Rejects use of a Builder from a missing, completed, or different Construction session. -
enter
-
leave
public static void leave() -
executeIfReady
public static void executeIfReady() -
getRootObject
-