2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.api.stmt;
10 import java.util.Collection;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
15 @Rfc6020AbnfRule("type-stmt")
16 public interface TypeStatement extends DeclaredStatement<String> {
18 @Nonnull String getName();
20 @Rfc6020AbnfRule("numerical-restrictions")
21 interface NumericalRestrictions extends TypeStatement {
23 @Nonnull RangeStatement getRange();
26 @Rfc6020AbnfRule("decimal64-specification")
27 interface Decimal64Specification extends TypeStatement {
29 @Nonnull FractionDigitsStatement getFractionDigits();
31 @Nullable RangeStatement getRange();
34 @Rfc6020AbnfRule("string-restrictions")
35 interface StringRestrictions extends TypeStatement {
37 @Nullable LengthStatement getLength();
39 @Nonnull Collection<? extends PatternStatement> getPatterns();
42 @Rfc6020AbnfRule("enum-specification")
43 interface EnumSpecification extends TypeStatement {
45 @Nonnull Collection<? extends EnumStatement> getEnums();
48 @Rfc6020AbnfRule("leafref-specification")
49 interface LeafrefSpecification extends TypeStatement {
51 @Nonnull PathStatement getPath();
54 * All implementations should override this method.
55 * The default definition of this method is used only in YANG 1.0 (RFC6020) implementation of
56 * LeafrefSpecification which does not support require-instance statement.
57 * YANG leafref type has been changed in YANG 1.1 (RFC7950) and now allows require-instance statement.
59 * @return require-instance statement
61 // FIXME: version 2.0.0: make this method non-default
62 @Nullable default RequireInstanceStatement getRequireInstance() {
67 @Rfc6020AbnfRule("instanceidentifier-specification")
68 interface InstanceIdentifierSpecification extends TypeStatement {
70 @Nullable RequireInstanceStatement getRequireInstance();
73 @Rfc6020AbnfRule("identityref-specification")
74 interface IdentityRefSpecification extends TypeStatement {
76 @Nonnull BaseStatement getBase();
79 @Rfc6020AbnfRule("bits-specification")
80 interface BitsSpecification extends TypeStatement {
82 @Nonnull Collection<? extends BitStatement> getBits();
85 @Rfc6020AbnfRule("union-specification")
86 interface UnionSpecification extends TypeStatement {
88 @Nonnull Collection<? extends TypeStatement> getTypes();
91 @Rfc6020AbnfRule("binary-specification")
92 interface BinarySpecification extends TypeStatement {
94 @Nullable LengthStatement getLength();