1 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
3 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.MustEffectiveStatementImpl;
5 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
6 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
7 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
8 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
9 import org.opendaylight.yangtools.yang.model.api.stmt.ErrorAppTagStatement;
10 import org.opendaylight.yangtools.yang.model.api.stmt.ErrorMessageStatement;
11 import org.opendaylight.yangtools.yang.model.api.stmt.MustStatement;
12 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
13 import org.opendaylight.yangtools.yang.model.util.RevisionAwareXPathImpl;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
18 import javax.annotation.Nonnull;
19 import javax.annotation.Nullable;
21 public class MustStatementImpl extends AbstractDeclaredStatement<RevisionAwareXPath> implements
24 protected MustStatementImpl(
25 StmtContext<RevisionAwareXPath, MustStatement, ?> context) {
29 public static class Definition extends AbstractStatementSupport<RevisionAwareXPath,MustStatement,EffectiveStatement<RevisionAwareXPath,MustStatement>> {
32 super(Rfc6020Mapping.MUST);
35 @Override public RevisionAwareXPath parseArgumentValue(
36 StmtContext<?, ?, ?> ctx, String value) throws SourceException {
37 return new RevisionAwareXPathImpl(value, false);
40 @Override public MustStatement createDeclared(
41 StmtContext<RevisionAwareXPath, MustStatement, ?> ctx) {
42 return new MustStatementImpl(ctx);
45 @Override public EffectiveStatement<RevisionAwareXPath, MustStatement> createEffective(
46 StmtContext<RevisionAwareXPath, MustStatement, EffectiveStatement<RevisionAwareXPath, MustStatement>> ctx) {
47 return new MustEffectiveStatementImpl(ctx);
52 public RevisionAwareXPath getCondition() {
57 public ErrorAppTagStatement getErrorAppTagStatement() {
58 return firstDeclared(ErrorAppTagStatement.class);
62 public ErrorMessageStatement getErrorMessageStatement() {
63 return firstDeclared(ErrorMessageStatement.class);
67 public DescriptionStatement getDescription() {
68 return firstDeclared(DescriptionStatement.class);
72 public ReferenceStatement getReference() {
73 return firstDeclared(ReferenceStatement.class);