import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
@Rfc6020AbnfRule("type-stmt")
-public interface TypeStatement extends DeclaredStatement<QName> {
+public interface TypeStatement extends DeclaredStatement<String> {
@Nonnull String getName();
interface NumericalRestrictions extends TypeStatement {
@Nonnull RangeStatement getRange();
-
}
@Rfc6020AbnfRule("decimal64-specification")
@Nonnull FractionDigitsStatement getFractionDigits();
@Nullable RangeStatement getRange();
-
}
@Rfc6020AbnfRule("string-restrictions")
interface EnumSpecification extends TypeStatement {
@Nonnull Collection<? extends EnumStatement> getEnums();
-
}
@Rfc6020AbnfRule("leafref-specification")
interface LeafrefSpecification extends TypeStatement {
- @Nullable PathStatement getPath();
-
+ @Nonnull PathStatement getPath();
+
+ /**
+ * All implementations should override this method.
+ * The default definition of this method is used only in YANG 1.0 (RFC6020) implementation of
+ * LeafrefSpecification which does not support require-instance statement.
+ * YANG leafref type has been changed in YANG 1.1 (RFC7950) and now allows require-instance statement.
+ *
+ * @return require-instance statement
+ */
+ // FIXME: version 2.0.0: make this method non-default
+ @Nullable default RequireInstanceStatement getRequireInstance() {
+ return null;
+ }
}
+ @Rfc6020AbnfRule("instanceidentifier-specification")
interface InstanceIdentifierSpecification extends TypeStatement {
@Nullable RequireInstanceStatement getRequireInstance();
}
-
+ @Rfc6020AbnfRule("identityref-specification")
interface IdentityRefSpecification extends TypeStatement {
-
+ /**
+ * Returns the base statements.
+ *
+ * @return collection of base statements (in YANG 1.1 models) or a collection containing just one base
+ * statement (in YANG 1.0 models)
+ */
+ @Nonnull Collection<? extends BaseStatement> getBases();
}
+
+ @Rfc6020AbnfRule("bits-specification")
interface BitsSpecification extends TypeStatement {
@Nonnull Collection<? extends BitStatement> getBits();
-
}
+ @Rfc6020AbnfRule("union-specification")
interface UnionSpecification extends TypeStatement {
@Nonnull Collection<? extends TypeStatement> getTypes();
+ }
+ @Rfc6020AbnfRule("binary-specification")
+ interface BinarySpecification extends TypeStatement {
+
+ @Nullable LengthStatement getLength();
}
}