import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.BaseStringStatementSupport;
+import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatements;
+import org.opendaylight.yangtools.yang.model.ri.stmt.EffectiveStatements;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStringStatementSupport;
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.SubstatementValidator;
public final class DescriptionStatementSupport
- extends BaseStringStatementSupport<DescriptionStatement, DescriptionEffectiveStatement> {
+ extends AbstractStringStatementSupport<DescriptionStatement, DescriptionEffectiveStatement> {
private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(
YangStmtMapping.DESCRIPTION).build();
private static final DescriptionStatementSupport INSTANCE = new DescriptionStatementSupport();
@Override
protected DescriptionStatement createDeclared(final StmtContext<String, DescriptionStatement, ?> ctx,
final ImmutableList<? extends DeclaredStatement<?>> substatements) {
- return new RegularDescriptionStatement(ctx.getRawArgument(), substatements);
+ return DeclaredStatements.createDescription(ctx.getRawArgument(), substatements);
}
@Override
protected DescriptionStatement createEmptyDeclared(final StmtContext<String, DescriptionStatement, ?> ctx) {
- return new EmptyDescriptionStatement(ctx.getRawArgument());
+ return DeclaredStatements.createDescription(ctx.getRawArgument());
}
@Override
protected DescriptionEffectiveStatement createEffective(final Current<String, DescriptionStatement> stmt,
final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
- return substatements.isEmpty() ? new EmptyDescriptionEffectiveStatement(stmt.declared())
- : new RegularDescriptionEffectiveStatement(stmt.declared(), substatements);
+ return EffectiveStatements.createDescription(stmt.declared(), substatements);
}
}