import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractQNameStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
/**
- * Specialization of {@link BaseQNameStatementSupport} for {@code input} and {@code output} statements.
+ * Specialization of {@link AbstractQNameStatementSupport} for {@code input} and {@code output} statements.
*
* @param <D> Declared Statement representation
* @param <E> Effective Statement representation
protected BaseOperationContainerStatementSupport(final StatementDefinition publicDefinition,
final Function<QNameModule, QName> createArgument) {
- super(publicDefinition);
+ super(publicDefinition, uninstantiatedPolicy());
this.createArgument = requireNonNull(createArgument);
}
return createArgument.apply(StmtContextUtils.getRootModuleQName(ctx));
}
+ @Override
+ protected final @NonNull E copyDeclaredEffective(final Current<QName, D> stmt, final E original) {
+ return copyDeclaredEffective(
+ EffectiveStatementMixins.historyAndStatusFlags(stmt.history(), original.effectiveSubstatements()),
+ stmt, original);
+ }
+
+ protected abstract @NonNull E copyDeclaredEffective(int flags, @NonNull Current<QName, D> stmt,
+ @NonNull E original);
+
+ @Override
+ protected final @NonNull E copyUndeclaredEffective(final Current<QName, D> stmt, final E original) {
+ return copyUndeclaredEffective(
+ EffectiveStatementMixins.historyAndStatusFlags(stmt.history(), original.effectiveSubstatements()),
+ stmt, original);
+ }
+
+ protected abstract @NonNull E copyUndeclaredEffective(int flags, @NonNull Current<QName, D> stmt,
+ @NonNull E original);
+
@Override
protected final @NonNull E createDeclaredEffective(final Current<QName, D> stmt,
final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
try {
- return createDeclaredEffective(historyAndStatusFlags(stmt.history(), substatements), stmt, substatements);
+ return createDeclaredEffective(
+ EffectiveStatementMixins.historyAndStatusFlags(stmt.history(), substatements), stmt, substatements);
} catch (SubstatementIndexingException e) {
throw new SourceException(e.getMessage(), stmt, e);
}
@Override
protected final E createUndeclaredEffective(final Current<QName, D> stmt,
final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
- return createUndeclaredEffective(historyAndStatusFlags(stmt.history(), substatements), stmt, substatements);
+ return createUndeclaredEffective(EffectiveStatementMixins.historyAndStatusFlags(stmt.history(), substatements),
+ stmt, substatements);
}
protected abstract @NonNull E createUndeclaredEffective(int flags, @NonNull Current<QName, D> stmt,