private abstract static class AbstractPathPrerequisite<C extends StmtContext<?, ?, ?>, K>
extends AbstractPrerequisite<C> implements OnNamespaceItemAdded {
- private final ModelProcessingPhase modPhase;
private final Iterable<K> keys;
private final Iterator<K> it;
- AbstractPathPrerequisite(final ModifierImpl modifier, final ModelProcessingPhase phase,
- final Iterable<K> keys) {
+ AbstractPathPrerequisite(final ModifierImpl modifier, final Iterable<K> keys) {
super(modifier);
- this.modPhase = requireNonNull(phase);
this.keys = requireNonNull(keys);
it = keys.iterator();
}
return;
}
- nextStep(modPhase, context, target);
+ nextStep(context, target);
if (!it.hasNext()) {
// Last step: we are done
hookOnto(target, namespace, it.next());
}
- abstract void nextStep(ModelProcessingPhase phase, StatementContextBase<?, ?, ?> current,
- StatementContextBase<?, ?, ?> next);
+ abstract void nextStep(StatementContextBase<?, ?, ?> current, StatementContextBase<?, ?, ?> next);
@Override
final ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return super.addToStringAttributes(toStringHelper).add("phase", modPhase).add("keys", keys);
+ return super.addToStringAttributes(toStringHelper).add("phase", EFFECTIVE_MODEL).add("keys", keys);
}
final void hookOnto(final StmtContext<?, ?, ?> context, final ParserNamespace<?, ?> namespace) {
private static final class PhaseRequirementInNamespacePath<C extends StmtContext<?, ?, ?>, K>
extends AbstractPathPrerequisite<C, K> {
PhaseRequirementInNamespacePath(final ModifierImpl modifier, final Iterable<K> keys) {
- super(modifier, EFFECTIVE_MODEL, keys);
+ super(modifier, keys);
}
@Override
- void nextStep(final ModelProcessingPhase phase, final StatementContextBase<?, ?, ?> current,
- final StatementContextBase<?, ?, ?> next) {
+ void nextStep(final StatementContextBase<?, ?, ?> current, final StatementContextBase<?, ?, ?> next) {
// No-op
}
}
private static final class PhaseModificationInNamespacePath<C extends Mutable<?, ?, ?>, K>
extends AbstractPathPrerequisite<C, K> implements ContextMutation {
PhaseModificationInNamespacePath(final ModifierImpl modifier, final Iterable<K> keys) {
- super(modifier, EFFECTIVE_MODEL, keys);
+ super(modifier, keys);
}
@Override
}
@Override
- void nextStep(final ModelProcessingPhase phase, final StatementContextBase<?, ?, ?> current,
- final StatementContextBase<?, ?, ?> next) {
+ void nextStep(final StatementContextBase<?, ?, ?> current, final StatementContextBase<?, ?, ?> next) {
// Hook onto target: we either have a modification of the target itself or one of its children.
- next.addMutation(phase, this);
+ next.addMutation(EFFECTIVE_MODEL, this);
// We have completed the context -> target step, hence we are no longer directly blocking context from
// making forward progress.
- current.removeMutation(phase, this);
+ current.removeMutation(EFFECTIVE_MODEL, this);
}
}
}