import org.opendaylight.yangtools.yang.model.api.stmt.DefaultEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.MandatoryEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.StatusEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatements;
+import org.opendaylight.yangtools.yang.model.ri.stmt.EffectiveStatements;
+import org.opendaylight.yangtools.yang.model.spi.meta.EffectiveStatementMixins.EffectiveStatementWithFlags.FlagsBuilder;
+import org.opendaylight.yangtools.yang.model.spi.meta.SubstatementIndexingException;
import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.YangValidationBundles;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.EffectiveStatementWithFlags.FlagsBuilder;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.SubstatementIndexingException;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.case_.CaseStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractSchemaTreeStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
@Override
protected ChoiceStatement createDeclared(@NonNull final StmtContext<QName, ChoiceStatement, ?> ctx,
final ImmutableList<? extends DeclaredStatement<?>> substatements) {
- return new RegularChoiceStatement(ctx.getArgument(), substatements);
+ return DeclaredStatements.createChoice(ctx.getArgument(), substatements);
}
@Override
protected ChoiceStatement createEmptyDeclared(@NonNull final StmtContext<QName, ChoiceStatement, ?> ctx) {
- return new EmptyChoiceStatement(ctx.getArgument());
+ return DeclaredStatements.createChoice(ctx.getArgument());
}
@Override
public ChoiceEffectiveStatement copyEffective(final Current<QName, ChoiceStatement> stmt,
final ChoiceEffectiveStatement original) {
- return new ChoiceEffectiveStatementImpl((ChoiceEffectiveStatementImpl) original,
- computeFlags(stmt, original.effectiveSubstatements()), stmt.effectivePath(),
- (ChoiceSchemaNode) stmt.original());
+ return EffectiveStatements.copyChoice(original, stmt.effectivePath(),
+ computeFlags(stmt, original.effectiveSubstatements()), stmt.original(ChoiceSchemaNode.class));
}
@Override
}
try {
- return new ChoiceEffectiveStatementImpl(stmt.declared(), substatements, computeFlags(stmt, substatements),
- stmt.effectivePath(), defaultCase, (ChoiceSchemaNode) stmt.original());
+ return EffectiveStatements.createChoice(stmt.declared(), stmt.effectivePath(),
+ computeFlags(stmt, substatements), substatements, defaultCase, stmt.original(ChoiceSchemaNode.class));
} catch (SubstatementIndexingException e) {
throw new SourceException(e.getMessage(), stmt, e);
}