Merge "Bug 2366: new parser - Types & TypeDefs support & resolution implemented Ident...
authorTony Tkacik <ttkacik@cisco.com>
Mon, 4 May 2015 13:03:41 +0000 (13:03 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 4 May 2015 13:03:41 +0000 (13:03 +0000)
136 files changed:
benchmarks/pom.xml
code-generator/binding-data-codec/pom.xml
code-generator/binding-generator-api/pom.xml
code-generator/binding-generator-impl/pom.xml
code-generator/binding-generator-spi/pom.xml
code-generator/binding-generator-util/pom.xml
code-generator/binding-java-api-generator/pom.xml
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/ClassTemplate.xtend
code-generator/binding-model-api/pom.xml
code-generator/binding-parent/pom.xml
code-generator/binding-test-model/pom.xml
code-generator/binding-type-provider/pom.xml
code-generator/maven-sal-api-gen-plugin/pom.xml
code-generator/pom.xml
code-generator/samples/maven-code-gen-sample/pom.xml
code-generator/samples/modeling-sample/pom.xml
common/artifacts/pom.xml
common/checkstyle-logging/pom.xml
common/checkstyle-logging/src/test/java/org/opendaylight/yangtools/checkstyle/CheckstyleTest.java
common/concepts/pom.xml
common/features-test/pom.xml
common/features/pom.xml
common/mockito-configuration/pom.xml
common/object-cache-api/pom.xml
common/object-cache-guava/pom.xml
common/object-cache-noop/pom.xml
common/parent/pom.xml
common/pom.xml
common/util/pom.xml
integration-test/bug1196-test-model/pom.xml
integration-test/bug527-test-model/pom.xml
integration-test/bundle-test/pom.xml
integration-test/pom.xml
integration-test/regression-test-model/pom.xml
integration-test/test-models/pom.xml
integration-test/yang-runtime-tests/pom.xml
model/iana/iana-afn-safi/pom.xml
model/iana/iana-if-type-2014-05-08/pom.xml
model/iana/iana-if-type/pom.xml
model/iana/pom.xml
model/ietf/ietf-inet-types/pom.xml
model/ietf/ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilderTest.java
model/ietf/ietf-interfaces/pom.xml
model/ietf/ietf-restconf/pom.xml
model/ietf/ietf-ted/pom.xml
model/ietf/ietf-topology-isis/pom.xml
model/ietf/ietf-topology-l3-unicast-igp/pom.xml
model/ietf/ietf-topology-ospf/pom.xml
model/ietf/ietf-topology/pom.xml
model/ietf/ietf-yang-types-20130715/pom.xml
model/ietf/ietf-yang-types/pom.xml
model/ietf/pom.xml
model/l2-types/pom.xml
model/pom.xml
model/yang-ext/pom.xml
pom.xml
restconf/pom.xml
restconf/restconf-client-api/pom.xml
restconf/restconf-client-impl/pom.xml
restconf/restconf-common/pom.xml
restconf/restconf-jaxrs-api/pom.xml
restconf/restconf-test-service/pom.xml
restconf/restconf-util/pom.xml
third-party/antlr4-runtime-osgi/pom.xml
third-party/pom.xml
websocket/pom.xml
websocket/websocket-client/pom.xml
yang-validation-tool/pom.xml
yang/pom.xml
yang/yang-binding/pom.xml
yang/yang-common/pom.xml
yang/yang-data-api/pom.xml
yang/yang-data-codec-gson/pom.xml
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/RpcAsContainer.java
yang/yang-data-impl/pom.xml
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerAttrNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNode.java
yang/yang-data-operations/pom.xml
yang/yang-data-util/pom.xml
yang/yang-maven-plugin-it/pom.xml
yang/yang-maven-plugin-spi/pom.xml
yang/yang-maven-plugin/pom.xml
yang/yang-model-api/pom.xml
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Rfc6020Mapping.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/TypeStatement.java
yang/yang-model-export/pom.xml
yang/yang-model-parent/pom.xml
yang/yang-model-util/pom.xml
yang/yang-parser-api/pom.xml
yang/yang-parser-impl/pom.xml
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/YangStatementParserListenerImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/IdentityNamespace.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/BuildGlobalContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SourceSpecificContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SubstatementContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BinarySpecificationImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BitStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BitsSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Decimal64SpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/EnumSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/EnumStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ExtensionStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/GroupingStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/IdentityRefSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/IdentityStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/InstanceIdentifierSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/LeafrefSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/MustStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/NumericalRestrictionsImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/PathStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/RequireInstanceStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/StringRestrictionsImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/TypeStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/TypedefStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/UnionSpecificationImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/WhenStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/YangInferencePipeline.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/BitEffectiveStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/BitsSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/Decimal64SpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/EnumSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/IdentityRefSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/InstanceIdentifierSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/LeafrefSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/NumericalRestrictionsEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/PathEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/RequireInstanceEffectiveStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/StringRestrictionsEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeDefEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/UnionSpecificationEffectiveStatementImpl.java [new file with mode: 0644]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/UnitsEffectiveStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/WhenEffectiveStatementImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/YangTypesStmtTest.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/semantic-statement-parser/simple-types.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/semantic-statement-parser/types.yang [new file with mode: 0644]

index 1c5b45ef603938fb728381de38df4292b5941f42..242a71d2fc40a23cdc7e8f06b0ef9321197347f2 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../common/parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -21,8 +21,8 @@
     <artifactId>benchmarks</artifactId>
 
     <properties>
-        <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
-        <yang.maven.plugin.version>0.7.0-SNAPSHOT</yang.maven.plugin.version>
+        <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+        <yang.maven.plugin.version>0.8.0-SNAPSHOT</yang.maven.plugin.version>
         <java.source.version>1.7</java.source.version>
         <java.target.version>1.7</java.target.version>
         <jmh.version>0.9.7</jmh.version>
index ad611d2d2dfc1240fae07f6c87be09669143058d..f6a179fd88c33bc8b7db142e54d36e123640bf3b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index 691f8e5a84a9826b1f152db62d4bdc5f57f3a046..b475ad3e3fbd64c6dd73e9059f152fbeb4180718 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index c5ed3cfdb6e8028c117216799a60177ead59d70b..d446c82c1ff9c864467863d4b5034f8e137ddf43 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index 185fd691430bce9927158397f159886d10870fd9..4ed76cc1f76e798d35697e4fd1cac4cb592de5b0 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index 367aaff67bee2e38b019940bad8e87ce535863e2..80e09f2382ec27e0ab6c4bc3cdf8c0f5d1040151 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index 51aa5c7629c587f4ef3310e688d9044adaf504eb..541d2f5859b6ae45e98267d2ab991aa3c5f3ef20 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index cc3a78809a8215943b3f82a2469f8f54ed705313..6699d502006c1682cea241daa1d322b033a67d8c 100644 (file)
@@ -290,15 +290,10 @@ class ClassTemplate extends BaseTemplate {
 
             Â«FOR c : consts»
                 Â«IF c.name == TypeConstants.PATTERN_CONSTANT_NAME && c.value instanceof List<?>»
-            boolean valid = false;
             for (Pattern p : patterns) {
-                if (p.matcher(_value).matches()) {
-                    valid = true;
-                    break;
-                }
+                Â«Preconditions.importedName».checkArgument(p.matcher(_value).matches(), "Supplied value \"%s\" does not match any of the permitted patterns %s", _value, Â«TypeConstants.PATTERN_CONSTANT_NAME»);
             }
 
-            Â«Preconditions.importedName».checkArgument(valid, "Supplied value \"%s\" does not match any of the permitted patterns %s", _value, Â«TypeConstants.PATTERN_CONSTANT_NAME»);
                 Â«ENDIF»
             Â«ENDFOR»
         Â«ENDIF»
index 2403d6e958d22803fae866a505821de1b9658468..235167ef7d6353fe93d83a071c31d11419c919d7 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index c38481e8d499af78d692e66f4c70d63ac1e3ed8c..cc1013ac8aefe52231c9e7a8d38be3e945de8ae6 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.opendaylight.yangtools</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.7.0-SNAPSHOT</version>
+    <version>0.8.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
-        <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+        <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
         <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
     </properties>
 
index c93a84c7c133e1133a4443aad2c86743e69f9958..b759f86bdd0665cde31c98bd40e45d04043b3dd0 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
index f496868a3f49f4f22e7fa738e6a59f0cfab864cf..f19246475434ef75944dc9136ae55881826cf3ec 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index d7d20c1489e13b118f711b34815436f2cff7ae96..c82c75a8f4dcbf3d68210d798b48770252fbc630 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>maven-sal-api-gen-plugin</artifactId>
index 324088dc7d3cffba53ada40b6ead92b7cf8f5f2e..2ce6df0c2a0c3c9e4980a6bd8450f60f8f45c404 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../common/parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index 52daaac3b81ab05af8626d7069b9909db9c0c804..765ebe254414fc1e4402af327c088d9482275ffc 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <artifactId>maven-code-gen-sample</artifactId>
 
index 4e1adde8af111b752b3b7f108a8d96dc8a8a5a31..ef68f03e62beffb93ade5a143f18339d259fdea5 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>binding-generator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <artifactId>modeling-sample</artifactId>
 
index 6d862f667510322cf84809552947cbb1802b054a..3f532b469da4d9317c8d0f5a14545091dad06109 100644 (file)
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.opendaylight.yangtools</groupId>
     <artifactId>yangtools-artifacts</artifactId>
-    <version>0.7.0-SNAPSHOT</version>
+    <version>0.8.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
         <!-- Model versions -->
-        <ietf.topology.version>2013.10.21.7-SNAPSHOT</ietf.topology.version>
+        <ietf.topology.version>2013.10.21.8-SNAPSHOT</ietf.topology.version>
     </properties>
 
     <dependencyManagement>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>iana-if-type-2014-05-08</artifactId>
-                <version>2014.05.08.7-SNAPSHOT</version>
+                <version>2014.05.08.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>ietf-inet-types</artifactId>
-                <version>2010.09.24.7-SNAPSHOT</version>
+                <version>2010.09.24.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>ietf-yang-types</artifactId>
-                <version>2010.09.24.7-SNAPSHOT</version>
+                <version>2010.09.24.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>ietf-yang-types-20130715</artifactId>
-                <version>2013.07.15.7-SNAPSHOT</version>
+                <version>2013.07.15.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>ietf-interfaces</artifactId>
-                <version>2014.05.08.7-SNAPSHOT</version>
+                <version>2014.05.08.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>ietf-restconf</artifactId>
-                <version>2013.10.19.7-SNAPSHOT</version>
+                <version>2013.10.19.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>opendaylight-l2-types</artifactId>
-                <version>2013.08.27.7-SNAPSHOT</version>
+                <version>2013.08.27.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools.model</groupId>
                 <artifactId>yang-ext</artifactId>
-                <version>2013.09.07.7-SNAPSHOT</version>
+                <version>2013.09.07.8-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
index a29a3fe38372ab5aae8bc21628b9487e8cb5fac0..238e78c7ea509ba0ea52587cdd163fd9a7f1e7c5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
   <artifactId>checkstyle-logging</artifactId>
@@ -21,7 +21,7 @@
     <dependency>
       <groupId>com.puppycrawl.tools</groupId>
       <artifactId>checkstyle</artifactId>
-      <version>5.7</version>
+      <version>6.1.1</version>
     </dependency>
     <dependency>
         <groupId>org.slf4j</groupId>
index 24e048ad97a2027a4989bac705dbd5e471f5baab..bf59c594b4b558ccb953f048eb9d5cc733cc29b8 100644 (file)
@@ -11,14 +11,6 @@ package org.opendaylight.yangtools.checkstyle;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.InputSource;
-
 import com.google.common.collect.Lists;
 import com.puppycrawl.tools.checkstyle.Checker;
 import com.puppycrawl.tools.checkstyle.ConfigurationLoader;
@@ -27,6 +19,12 @@ import com.puppycrawl.tools.checkstyle.PropertiesExpander;
 import com.puppycrawl.tools.checkstyle.api.AuditListener;
 import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
 import com.puppycrawl.tools.checkstyle.api.Configuration;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.xml.sax.InputSource;
 
 public class CheckstyleTest {
 
@@ -36,11 +34,11 @@ public class CheckstyleTest {
     @Before
     public void setup() throws CheckstyleException {
         baos = new ByteArrayOutputStream();
-        AuditListener listener = new DefaultLogger(baos, false);
+        final AuditListener listener = new DefaultLogger(baos, false);
 
-        InputSource inputSource = new InputSource(CheckstyleTest.class.getClassLoader().getResourceAsStream(
+        final InputSource inputSource = new InputSource(CheckstyleTest.class.getClassLoader().getResourceAsStream(
                 "checkstyle-logging.xml"));
-        Configuration configuration = ConfigurationLoader.loadConfiguration(inputSource,
+        final Configuration configuration = ConfigurationLoader.loadConfiguration(inputSource,
                 new PropertiesExpander(System.getProperties()), false);
 
         checker = new Checker();
@@ -66,7 +64,7 @@ public class CheckstyleTest {
     @Test
     public void testCodingChecks() {
         verify(CheckCodingStyleTestClass.class, false, "9: Line has Windows line delimiter.", "14: Wrong order for", "24:1: Line contains a tab character.",
-                "22: Line has trailing spaces.", "22: ctor def child at indentation level 16 not at correct indentation, 8", "17:8: Unused import",
+                "22: Line has trailing spaces.", "22: 'ctor def' child have incorrect indentation level 16, expected level should be 8.", "17:8: Unused import",
                 "23: Line has trailing spaces.");
     }
 
index d2b0867d8cb680838202e21192532e87b393dd86..c702ae1e51a7d31e481dc5239f2c55dc84caaf60 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 50ff2715034365bf65876ad73328533e238b8ae6..0e5dbf09735d061c376dcad8f4d18e4e6511b32d 100644 (file)
@@ -13,7 +13,7 @@
    <parent>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yangtools-parent</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
+      <version>0.8.0-SNAPSHOT</version>
       <relativePath>../parent/pom.xml</relativePath>
    </parent>
    <artifactId>features-test</artifactId>
@@ -27,7 +27,7 @@
      <relocation>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>features-test</artifactId>
-       <version>1.5.0-SNAPSHOT</version>
+       <version>1.6.0-SNAPSHOT</version>
        <message>This artifact has been migrated to odlparent and will be removed in Lithium release</message>
      </relocation>
    </distributionManagement>
index d59c952d30cbdf611cdfcb4c808d7df5d4b12c87..d6d1647e40cd3a74bbe4c9816b907001e0a8c54f 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>features-parent</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     <groupId>org.opendaylight.yangtools</groupId>
     <artifactId>features-yangtools</artifactId>
-    <version>0.7.0-SNAPSHOT</version>
+    <version>0.8.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <dependencyManagement>
index 1637e1f9cbc3ccdde018767b948a28fc700a1094..7788fe49f1366896e4012976c6eac19c985f8602 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 568834cdd80d2c26c2c1b064097022eb20ab8e81..0fc11fc5580e0eed09f806c3f841969fed8bb373 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
     <packaging>bundle</packaging>
index ed837d1ace1d9c2cf838bc7493b0112c23bccec3..e198df3ecf4e745f05efff92dbb9bfb505defd32 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 2105738dd66ec9b2aea519792c10135f68075055..7e4268c37b09b98659059d6d85ba75c02eb62f8d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
     <packaging>bundle</packaging>
index 6341f11cfb30960cbbed594077692c14c13642d3..da7b5eacbc2bb2ca9b991034e57cd4c49a9f3108 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <relativePath></relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>yangtools-parent</artifactId>
     <groupId>org.opendaylight.yangtools</groupId>
-    <version>0.7.0-SNAPSHOT</version>
+    <version>0.8.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
-        <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+        <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
 
         <!-- FIXME: these will be upstreamed -->
         <maven.depends.version>1.2</maven.depends.version>
                 <plugin>
                     <groupId>org.opendaylight.yangtools</groupId>
                     <artifactId>yang-maven-plugin</artifactId>
-                    <version>0.7.0-SNAPSHOT</version>
+                    <version>0.8.0-SNAPSHOT</version>
                     <executions>
                         <execution>
                             <goals>
                         <dependency>
                             <groupId>org.opendaylight.yangtools</groupId>
                             <artifactId>maven-sal-api-gen-plugin</artifactId>
-                            <version>0.7.0-SNAPSHOT</version>
+                            <version>0.8.0-SNAPSHOT</version>
                             <type>jar</type>
                         </dependency>
                     </dependencies>
index 8c0bf84b1bcfeb4183fc1474e8ef45feff2b9d0d..cff1d1feff58046bf946446ba7e863d0d101a2d8 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yangtools-parent</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
+      <version>0.8.0-SNAPSHOT</version>
       <relativePath>parent</relativePath>
     </parent>
 
index 9c9ab40246a8c12b87347792a62a01d4492c1d5c..c32b829dce8ec2c1749cc4b375e8f6b246871970 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
     <packaging>bundle</packaging>
index c2d2746263d5a24d6cb6f48934ab7ec0674fb84a..447b1fb2fb8351b05a6bbe52ec5a64fea6ee5c41 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
                     <dependency>
                         <groupId>org.opendaylight.yangtools</groupId>
                         <artifactId>yang-binding</artifactId>
-                        <version>0.7.0-SNAPSHOT</version>
+                        <version>0.8.0-SNAPSHOT</version>
                     </dependency>
                     <dependency>
                         <groupId>org.opendaylight.yangtools</groupId>
                         <artifactId>yang-common</artifactId>
-                        <version>0.7.0-SNAPSHOT</version>
+                        <version>0.8.0-SNAPSHOT</version>
                     </dependency>
                 </dependencies>
             </plugin>
index 9a7177229b87fd0b55d8d976c0098abe655ecae8..f65011a00299f0a36626ece49cd9e282c6951472 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 42235ace5c538515a5a26f7758e4fc5cb337f41e..7f16ef284b918ea1fed93aa7c8085c5946ececbf 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <artifactId>yangtools-parent</artifactId>
         <groupId>org.opendaylight.yangtools</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 0871e056e70544e2a207d4fd5daa8a73f3a7bb8d..8c1331dc552fa89acfc7d783c047e98412c9a316 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../common/parent</relativePath>
     </parent>
 
index 4b0a4f1d7f6a99858c3d8024934ca1f73ce7d0a6..ad25fcc8bbf87833e3d776541b4dafc45bd7cbd2 100644 (file)
@@ -9,7 +9,7 @@
 
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <artifactId>yangtools-parent</artifactId>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
index 656ed68187738ca04c3e010d71eb518a97f53720..749217dbc4a69d032a4fc4ed13a9241bc731191d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
@@ -60,7 +60,7 @@
                     <dependency>
                         <groupId>org.opendaylight.yangtools</groupId>
                         <artifactId>maven-sal-api-gen-plugin</artifactId>
-                        <version>0.7.0-SNAPSHOT</version>
+                        <version>0.8.0-SNAPSHOT</version>
                         <type>jar</type>
                     </dependency>
                 </dependencies>
index c145dc54ffa19de9a9f83f97f5e2c58a0a4aa5fe..89c0b68fbacae1b35cf068b8383487bf463bcd97 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 57bd56c9be34eae1848c01c97ecd40916b20ed27..de82000313359b0b9a45d764d11123ed969a07c5 100644 (file)
     <parent>
         <artifactId>model-iana</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>iana-afn-safi</artifactId>
-    <version>2013.07.04.7-SNAPSHOT</version>
+    <version>2013.07.04.8-SNAPSHOT</version>
 
     <build>
         <plugins>
index 979dfdf819dca75e3688a3ccf287a5ea87d6077f..3815db3fc5dc94d23eb673913e99850ec3c39168 100644 (file)
     <parent>
         <artifactId>model-iana</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>iana-if-type-2014-05-08</artifactId>
-    <version>2014.05.08.7-SNAPSHOT</version>
+    <version>2014.05.08.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index b354c1c7cab3d46479b8f31afe5ccf05acaed39a..fb011b8145af34f2a7d2894345684749d3824e7a 100644 (file)
     <parent>
         <artifactId>model-iana</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>iana-if-type</artifactId>
-    <version>2013.07.04.7-SNAPSHOT</version>
+    <version>2013.07.04.8-SNAPSHOT</version>
 
     <build>
         <plugins>
index 13eb5db290d5645de0684c1b0d80652b30e98234..843c084db3211070576c3a4672ea2307132cc1e2 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <artifactId>model-parent</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
index 9759f5ce93a98b7351f8b2762aa1f04ac77578d7..cad85086202a35ccbdfc659a814879c0f45f4970 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-inet-types</artifactId>
-    <version>2010.09.24.7-SNAPSHOT</version>
+    <version>2010.09.24.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 1339fc06cf7e101ae6d1e1183a5c6aabeb9721db..d2259d006b21382a680aebf62da509e503065b1f 100644 (file)
@@ -16,24 +16,23 @@ public class HostBuilderTest {
 
     @Test
     public void testGetDefaultInstanceIpv4() throws Exception {
-        Host host = HostBuilder.getDefaultInstance("127.0.0.1");
+        final Host host = HostBuilder.getDefaultInstance("127.0.0.1");
         assertEquals(new Host(new IpAddress(new Ipv4Address("127.0.0.1"))), host);
     }
 
     @Test
     public void testGetDefaultInstanceIpv6() throws Exception {
-        testIpv6("2001:db8:8s5a3:0:0:8a2e:370:7334");
-        testIpv6("2001:db8:85a3::8a2e:370:7334");
+        testIpv6("1234:5678:9abc:def1:2345:6789:abcd:ef12");
     }
 
     private void testIpv6(final String ivp6string) {
-        Host host = HostBuilder.getDefaultInstance(ivp6string);
+        final Host host = HostBuilder.getDefaultInstance(ivp6string);
         assertEquals(new Host(new IpAddress(new Ipv6Address(ivp6string))), host);
     }
 
     @Test
     public void testGetDefaultInstanceDomain() throws Exception {
-        Host host = HostBuilder.getDefaultInstance("localhost");
+        final Host host = HostBuilder.getDefaultInstance("localhost");
         assertEquals(new Host(new DomainName("localhost")), host);
     }
 }
\ No newline at end of file
index f1bc48457d309772e32222cd001edd3ddda64f47..ac561979dc3694e62d7a5ca3dcccf259b39a0b3f 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-interfaces</artifactId>
-    <version>2014.05.08.7-SNAPSHOT</version>
+    <version>2014.05.08.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index e9ce3701373f407357650f202c1ad09ee3543653..f25ffe79468a13578d665c21f3a3e82262f7a46d 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-restconf</artifactId>
-    <version>2013.10.19.7-SNAPSHOT</version>
+    <version>2013.10.19.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index d8f758d8783473e94a151943f9ea813678dd585a..f060fe23f506aefb9b2ec20a75cf1c95ed2b206d 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-ted</artifactId>
-    <version>2013.10.21.7-SNAPSHOT</version>
+    <version>2013.10.21.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 77c026bf4cc652531e53f3aa267e7580e3430878..9063160570836bffbba39e424bb67c15d66b862b 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-topology-isis</artifactId>
-    <version>2013.10.21.7-SNAPSHOT</version>
+    <version>2013.10.21.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 6d00b7814b7bced60b344438696f38be43e4b17a..071d5aadb2168d6cb4bad1744b576bea1eb7d432 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-topology-l3-unicast-igp</artifactId>
-    <version>2013.10.21.7-SNAPSHOT</version>
+    <version>2013.10.21.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 64f2eb5dfa067109074c8d6447278be96ce00728..7344aab89bbc2c977e16a7a2c32169240d26b88e 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-topology-ospf</artifactId>
-    <version>2013.10.21.7-SNAPSHOT</version>
+    <version>2013.10.21.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index ea135bbb88bbb9977c42b1a6da4c6c027b457266..1954710a68a5e2eafc93bfdca49174e9985961e0 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-topology</artifactId>
-    <version>2013.10.21.7-SNAPSHOT</version>
+    <version>2013.10.21.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 25df3cebcaf72566136ac31e49f952116246de04..9d6c5eeba4220935f12b560c8989619b1f4ee7bd 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-yang-types-20130715</artifactId>
-    <version>2013.07.15.7-SNAPSHOT</version>
+    <version>2013.07.15.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 685d70daff2ed1adc8d0a02402b682a2c11e68c2..9c20f894354eabc56dc7dc76bc4816077ef0131a 100644 (file)
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-yang-types</artifactId>
-    <version>2010.09.24.7-SNAPSHOT</version>
+    <version>2010.09.24.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
index 5677b0c11bd687a46b0a487bc18a24d6f6242e6a..0e958f85c2a7745ba53d20513f2044af7f7b514b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <artifactId>model-parent</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index c47cc0a90e3494baab6438743a3ae3e9bd3c1346..0b27bcd067fdd24707e30a7b9063554f4817010d 100644 (file)
     <parent>
         <artifactId>model-parent</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>opendaylight-l2-types</artifactId>
-    <version>2013.08.27.7-SNAPSHOT</version>
+    <version>2013.08.27.8-SNAPSHOT</version>
 
     <build>
         <plugins>
index 206d1b288601b9a6c7f974a14bec51facaf75d07..cc77098d0d383cd59d080e156e7791cc9f7c9c95 100644 (file)
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../common/parent</relativePath>
     </parent>
     <groupId>org.opendaylight.yangtools.model</groupId>
-    <!--<version>0.7.0-SNAPSHOT</version>-->
+    <!--<version>0.8.0-SNAPSHOT</version>-->
     <modelVersion>4.0.0</modelVersion>
     <artifactId>model-parent</artifactId>
     <packaging>pom</packaging>
@@ -68,7 +68,7 @@
                     <dependency>
                         <groupId>org.opendaylight.yangtools</groupId>
                         <artifactId>maven-sal-api-gen-plugin</artifactId>
-                        <version>0.7.0-SNAPSHOT</version>
+                        <version>0.8.0-SNAPSHOT</version>
                         <type>jar</type>
                     </dependency>
                 </dependencies>
index 2bb3db677f40f85af0c3b6ab6006e3638fcfd344..3cbe1766fd3c7eda4480c989a2f8fc6c6df366b0 100644 (file)
     <parent>
         <artifactId>model-parent</artifactId>
         <groupId>org.opendaylight.yangtools.model</groupId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>yang-ext</artifactId>
-    <version>2013.09.07.7-SNAPSHOT</version>
+    <version>2013.09.07.8-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <description>${project.artifactId}</description>
 
diff --git a/pom.xml b/pom.xml
index e64f5c3bfe9bf6c56bfbea7efc8f9b2105c8011c..395da84e1b98f839ead10c4284afa644b7e5e98b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <parent>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yangtools-parent</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
+      <version>0.8.0-SNAPSHOT</version>
       <relativePath>common/parent</relativePath>
     </parent>
 
index fba0fb7d03ba2e67d937a9126f5b4c516277e216..084719b9979d79cc51257d7ad50f3536e1984b87 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../common/parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index 130e7dffbbbb1532dded88ad00f9ccb1dead98cc..2f2f003255a19c959ef9e35dfe7fa6ac90411885 100644 (file)
@@ -15,7 +15,7 @@
    <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <dependencies>
         <dependency>
index fe46d36d92b218e7e7db529914e726635580ac11..690c391d251b8bd572ce5f0a8efd9ffa277a0a82 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
   <artifactId>restconf-client-impl</artifactId>
index dbb4819085c9cf225890047d2d415d95bdefcc26..89926c8af84a5e4a6092e8f8629939b0067f45d4 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>restconf-common</artifactId>
index aa91bc614bed2c1fdb70357fa9b2073a515ab6fc..3ea648c92783ca5e0ee03af3fa9604fd550d6852 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <artifactId>restconf-jaxrs-api</artifactId>
     <name>restconf-jaxrs-api</name>
index 7c079b9c0f31bd9af6245a7f0ba994bcfce41317..9f36d6f9351b77ffe0c790543a6ac5cfe2d0b25b 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>restconf-test-service</artifactId>
index 9ebb9ba3a4e47ad18055bcf22a06a9ae16e7bc8b..3110382acae9bdaea82f838dcaa2efc73d78f465 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>restconf-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>restconf-util</artifactId>
index 7442f99b3a8205f92a85394e2cb97142e5badb5a..95ef64179c4aa186e0eb0fce30bcdf19f5051c8c 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>third-party-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
index c22c469cc2f12640b191530b351e5e98d44ab405..1727bdba7db9728d1c24c431f80dfc043a5fb228 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
index 8acd61daaffd8783a2a79b4b7731e98b1a7490dd..ab7fdff9d4d3f725ea05e17ef4b12addbb8748c7 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yangtools-parent</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
+      <version>0.8.0-SNAPSHOT</version>
       <relativePath>../common/parent</relativePath>
     </parent>
 
index 341099985966b42f5bf6985d8c7bae426651bbfd..5ed7bf67479054a387307f560c3b52f2ca4453d5 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 8dbaa1df2373af2b0b5a88fa4d9919aeb6859852..cbbc6ce6ea745b357efa347cd79aa4d2785a6159 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-aggregator</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
     </parent>
     <artifactId>yang-validation-tool</artifactId>
 
index 01e71bd5477661fc2afa507ff58fb3cfaa7a909a..546339a2abe179af3806e7b963d98d2edd3ce5d4 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yangtools-parent</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
+      <version>0.8.0-SNAPSHOT</version>
       <relativePath>../common/parent</relativePath>
     </parent>
 
index ada7f5a89ddd2a74a95f6d30a1f79c16af367a58..0d03ad751a775f524ff4700c6c2209a52613330a 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index dc732e3dab4aaf34e357bf2b469472b27a03ed21..19a2656d88d96fbc63b164f220743247b1c30571 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 688dbb1fdbe2757fdfe7c8cd5b9c0bfb368558cf..73505cd9977ba7c4f4ed73583946bd19df13d779 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index fd7481133768f0e605af26ad45b15cd741c1cbc0..f366cc1ebf227372e26255a3cbc8525dbd3909be 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 0b64b2296782e939dc239f5a6b93e9abb6b8a3ef..b9fddf3ecf5a063c86ddeab1a93b958f7f07641a 100644 (file)
@@ -93,8 +93,9 @@ final class RpcAsContainer implements ContainerSchemaNode {
                 return delegate.getInput();
             case "output":
                 return delegate.getOutput();
+            default:
+                return null;
         }
-        return null;
     }
 
     @Override
@@ -114,7 +115,7 @@ final class RpcAsContainer implements ContainerSchemaNode {
 
     @Override
     public Collection<DataSchemaNode> getChildNodes() {
-        final ArrayList<DataSchemaNode> ret = new ArrayList<>();
+        final List<DataSchemaNode> ret = new ArrayList<>();
         final ContainerSchemaNode input = getInput();
         final ContainerSchemaNode output = getOutput();
         if(input != null) {
index 951e19d180ccb2e23dbfe3169adb64a83e7bbf4a..ca55ad025516d66f82dd670031ee6104b3e1ae4c 100644 (file)
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 1742c03357aee94c4e503ee98f6c4f427822990e..f382586ef2d79e121c2b3d96810a528190a777c9 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 
 import com.google.common.base.MoreObjects.ToStringHelper;
 
+// FIXME: are attributes part of hashCode/equals?
 public abstract class AbstractImmutableDataContainerAttrNode<K extends YangInstanceIdentifier.PathArgument>
         extends AbstractImmutableDataContainerNode<K>
     implements AttributesContainer {
@@ -44,26 +45,4 @@ public abstract class AbstractImmutableDataContainerAttrNode<K extends YangInsta
         return super.addToStringAttributes(toStringHelper).add("attributes", attributes);
     }
 
-// FIXME: are attributes part of hashCode/equals?
-//    @Override
-//    protected int valueHashCode() {
-//        int result = super.valueHashCode();
-//        for (final Entry<?, ?> a : attributes.entrySet()) {
-//            result = 31 * result + a.hashCode();
-//        }
-//        return result;
-//    }
-
- // FIXME: are attributes part of hashCode/equals?
-//    @Override
-//    protected boolean valueEquals(final NormalizedNode<?, ?> other) {
-//        if (!super.valueEquals(other)) {
-//            return false;
-//        }
-//        final Set<Entry<QName, String>> tas = getAttributes().entrySet();
-//        final Set<Entry<QName, String>> oas = container.getAttributes().entrySet();
-//
-//        return tas.containsAll(oas) && oas.containsAll(tas);
-//        return true;
-//    }
 }
index ec615025ebd5def89fdadb5d04cdac283122cb48..842cf231f7126290ee13ff4e3c5ddf4ee7baa4dd 100644 (file)
@@ -43,10 +43,7 @@ public abstract class AbstractImmutableNormalizedValueAttrNode<K extends YangIns
     @Override
     protected int valueHashCode() {
         final int result = getValue() != null ? getValue().hashCode() : 1;
-// FIXME: are attributes part of hashCode/equals?
-//        for (final Entry<?, ?> a : attributes.entrySet()) {
-//            result = 31 * result + a.hashCode();
-//        }
+        // FIXME: are attributes part of hashCode/equals?
         return result;
     }
 
@@ -60,11 +57,6 @@ public abstract class AbstractImmutableNormalizedValueAttrNode<K extends YangIns
         }
 
         // FIXME: are attributes part of hashCode/equals?
-        // final Set<Entry<QName, String>> tas = getAttributes().entrySet();
-        // final Set<Entry<QName, String>> oas =
-        // container.getAttributes().entrySet();
-        //
-        // return tas.containsAll(oas) && oas.containsAll(tas);
         return true;
     }
 
index dec5406e42c133f1a19af14fc386e67a5ab2abaa..a11ebf851083d2007f77f37110e16260f49017cd 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 85d904a2698534df081c0e47ec91e626edb5d78a..fc0d94592c266beb3ee15f89ed9f0081be8a74af 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 29048f106d844ff46212fc71bad37b1e9e2dbb5c..c3e8eea65abb7492d277d96fead54b5dcf6f159e 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 3c88fe63fc49a502ff1e75ae114b4e658293027f..6cbbd6051b8d61f25b28020e82ae70671220acd0 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index ab9085398894e628fd1c76d2062229c8c9c7d163..35b6f770d8967f1560239a9b26487bc08d655d23 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 10361ba20ccb79768a550382f7e058819dcd576f..ca4d5540dde7d2e7c2f25a2dc3f8270ca3ded124 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 1bf809567dbc5d91ed5d3ef8b2e4b5d80ea7ae24..453ca4669914bea831a6d3a63022e204db831bca 100644 (file)
@@ -156,21 +156,21 @@ public enum Rfc6020Mapping implements StatementDefinition {
     private final QName argument;
     private final boolean yinElement;
 
-    private Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr) {
+    Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr) {
         type = Preconditions.checkNotNull(clz);
         name = yinQName(nameStr);
         argument = null;
         yinElement = false;
     }
 
-    private Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr, final String argumentStr) {
+    Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr, final String argumentStr) {
         type = Preconditions.checkNotNull(clz);
         name = yinQName(nameStr);
         argument = yinQName(argumentStr);
         this.yinElement = false;
     }
 
-    private Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr, final String argumentStr,
+    Rfc6020Mapping(Class<? extends DeclaredStatement<?>> clz, final String nameStr, final String argumentStr,
             final boolean yinElement) {
         type = Preconditions.checkNotNull(clz);
         name = yinQName(nameStr);
index 42b45c38b4e17f8d66c856e57ff13586511dad1d..cfb9d13124da9bbbbdc1c9a0dcd2cf0ebfa1a067 100644 (file)
@@ -51,28 +51,40 @@ public interface TypeStatement extends DeclaredStatement<String> {
     @Rfc6020AbnfRule("leafref-specification")
     interface LeafrefSpecification extends TypeStatement {
 
-        @Nullable PathStatement getPath();
+        @Nonnull PathStatement getPath();
 
     }
 
+    @Rfc6020AbnfRule("instanceidentifier-specification")
     interface InstanceIdentifierSpecification extends TypeStatement {
 
         @Nullable RequireInstanceStatement getRequireInstance();
     }
 
-
+    @Rfc6020AbnfRule("identityref-specification")
     interface IdentityRefSpecification extends TypeStatement {
 
+        @Nonnull BaseStatement getBase();
+
     }
+
+    @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();
+    }
 }
index 31f82961be842eefee343fc264153854b0db4223..81699215b7bade14eaf610123f5a1feaa005c310 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 50e2a926fd477971698d26091e4f5fb93046b68a..64284634adbc14c128d9bdbafd11c80cb4655fe0 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     <groupId>org.opendaylight.yangtools</groupId>
     <artifactId>yang-model-parent</artifactId>
     <packaging>pom</packaging>
-    <version>0.7.0-SNAPSHOT</version>
+    <version>0.8.0-SNAPSHOT</version>
 
     <properties>
-        <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+        <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
     </properties>
 
     <dependencyManagement>
index f484e09d3a54d878eebbef8a4a74c4dff36d26ce..06c1b73089a3253792f4c75c76e910da515766be 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index ee32cd90d54d5d17887485c376a8c4f2e0f1f830..448ef2f664cf9b1f4bcf0660587c3fc23f4c7990 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index 6115c83b578108ce4dc9e219c481516708a140bc..5cb407ed8da222d82d70eaaae65436e082aae5c0 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-parent</artifactId>
-        <version>0.7.0-SNAPSHOT</version>
+        <version>0.8.0-SNAPSHOT</version>
         <relativePath>/../../common/parent/pom.xml</relativePath>
     </parent>
 
index b5b3cf02915647a449fb6b25d3086f9fcb7ed44b..b6ee244501ec86cd5e28b01d1cf358c6e579162f 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -11,7 +11,6 @@ import java.util.ArrayList;
 import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.antlr.v4.runtime.tree.ParseTree;
 import org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParser;
 import org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParserBaseListener;
@@ -23,6 +22,7 @@ import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementWriter;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 
 import javax.annotation.concurrent.Immutable;
 
@@ -34,6 +34,7 @@ public class YangStatementParserListenerImpl extends YangStatementParserBaseList
     private QNameToStatementDefinition stmtDef;
     private PrefixToModule prefixes;
     private List<String> toBeSkipped = new ArrayList<>();
+    private boolean isType = false;
     private static final Logger LOG = LoggerFactory.getLogger(YangStatementParserListenerImpl.class);
 
     public YangStatementParserListenerImpl(StatementSourceReference ref) {
@@ -51,17 +52,31 @@ public class YangStatementParserListenerImpl extends YangStatementParserBaseList
         this.prefixes = prefixes;
     }
 
+    private static boolean hasNotEmptyBody(List<ParseTree> children) {
+        for (ParseTree child : children) {
+            if (child instanceof YangStatementParser.StatementContext) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     @Override
     public void enterStatement(YangStatementParser.StatementContext ctx) {
         boolean action = true;
+        QName identifier;
         for (int i = 0; i < ctx.getChildCount(); i++) {
             ParseTree child = ctx.getChild(i);
             if (child instanceof YangStatementParser.KeywordContext) {
                 try {
-                    QName identifier = new QName(YangConstants.RFC6020_YIN_NAMESPACE,
+                    identifier = new QName(YangConstants.RFC6020_YIN_NAMESPACE,
                             ((YangStatementParser.KeywordContext) child).children.get(0).getText());
                     if (stmtDef != null && Utils.isValidStatementDefinition(prefixes, stmtDef, identifier) && toBeSkipped.isEmpty()) {
-                        writer.startStatement(identifier, ref);
+                        if (identifier.equals(Rfc6020Mapping.TYPE.getStatementName()) && hasNotEmptyBody(((YangStatementParser.KeywordContext) child).getParent().children)) {
+                            isType = true;
+                        } else {
+                            writer.startStatement(identifier, ref);
+                        }
                     } else {
                         action = false;
                         toBeSkipped.add(((YangStatementParser.KeywordContext) child).children.get(0).getText());
@@ -71,9 +86,13 @@ public class YangStatementParserListenerImpl extends YangStatementParserBaseList
                 }
             } else if (child instanceof YangStatementParser.ArgumentContext) {
                 try {
-                    if (action) {
-                        writer.argumentValue(
-                                Utils.stringFromStringContext((YangStatementParser.ArgumentContext) child), ref);
+                    final String argument = Utils.stringFromStringContext((YangStatementParser.ArgumentContext) child);
+                    if (isType) {
+                        writer.startStatement(new QName(YangConstants.RFC6020_YIN_NAMESPACE, argument), ref);
+                        writer.argumentValue(argument, ref);
+                        isType = false;
+                    } else if (action) {
+                        writer.argumentValue(Utils.stringFromStringContext((YangStatementParser.ArgumentContext) child), ref);
                     } else {
                         action = true;
                     }
index fc0e3783d8560ad2e46333632dc249118722306e..b3d9118731205be50f57a8eb8b772b1b04f1b15d 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.yangtools.yang.parser.spi;
 
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 /**
  *
@@ -19,6 +21,6 @@ import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
  * identity identifier namespace.
  *
  */
-public interface IdentityNamespace extends IdentifierNamespace<QName, IdentityStatement> {
+public interface IdentityNamespace extends IdentifierNamespace<QName, StmtContext.Mutable<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>>> {
 
 }
index ad6d70a823c9060d454394b2460d8cc43ce4f2b3..bbf2838548c0752f95553e2759f6c48c652b3df0 100644 (file)
@@ -195,10 +195,15 @@ class BuildGlobalContext extends NamespaceStorageSupport implements NamespaceBeh
                     switch (sourceProgress) {
                         case FINISHED:
                             currentSource.remove();
+                            // Fallback to progress, since we were able to make progress in computation
                         case PROGRESS:
                             progressing = true;
+                            break;
                         case NO_PROGRESS:
-                            // Noop;
+                            // Noop
+                            break;
+                        default:
+                           throw new IllegalStateException("Unsupported phase progress " + sourceProgress);
                     }
                 }
             }
index 847f8e988e43040f221fbcd064af34cefd225d37..bf00b764a5eb3a0751ab8c4bc45434425e25f1c0 100644 (file)
@@ -7,25 +7,19 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.reactor;
 
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
 import com.google.common.base.Preconditions;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Multimap;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Objects;
-import javax.annotation.Nullable;
 import org.opendaylight.yangtools.concepts.Mutable;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
+import org.opendaylight.yangtools.yang.model.util.BaseTypes;
 import org.opendaylight.yangtools.yang.parser.spi.ExtensionNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ImportedNamespaceContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
@@ -43,9 +37,25 @@ import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase.ContextBuilder;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.BitsSpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Decimal64SpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.EnumSpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.IdentityRefSpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.InstanceIdentifierSpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.LeafrefSpecificationImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.NumericalRestrictionsImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.StringRestrictionsImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UnionSpecificationImpl;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UnknownStatementImpl;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
 
+import javax.annotation.Nullable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Objects;
+
 public class SourceSpecificContext implements NamespaceStorageNode, NamespaceBehaviour.Registry, Mutable {
 
     public enum PhaseCompletionProgress {
@@ -79,8 +89,11 @@ public class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeh
     ContextBuilder<?, ?, ?> createDeclaredChild(StatementContextBase<?, ?, ?> current, QName name, StatementSourceReference ref) {
         StatementDefinitionContext<?,?,?> def = getDefinition(name);
 
-        //extensions
-        if (def == null) {
+        if (def == null && BaseTypes.isYangBuildInType(name.getLocalName())) {
+            //type-body-stmts
+            def = resolveTypeBodyStmts(name.getLocalName());
+        } else if (def == null) {
+            //extensions
             if (Utils.isValidStatementDefinition(prefixToModuleMap, qNameToStmtDefMap, name)) {
                 def = new StatementDefinitionContext<>(new UnknownStatementImpl.Definition(qNameToStmtDefMap.get(Utils.trimPrefix(name))));
             }
@@ -246,6 +259,32 @@ public class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeh
         }
     }
 
+    private StatementDefinitionContext<?,?,?> resolveTypeBodyStmts(String typeArgument) {
+        switch (typeArgument) {
+            case "int8": case "int16": case "int32": case "int64": case "uint8": case "uint16": case "uint32": case "uint64":
+                return new StatementDefinitionContext<>(new NumericalRestrictionsImpl.Definition());
+            case "decimal64":
+                return new StatementDefinitionContext<>(new Decimal64SpecificationImpl.Definition());
+            case "union":
+                return new StatementDefinitionContext<>(new UnionSpecificationImpl.Definition());
+            case "string":
+                return new StatementDefinitionContext<>(new StringRestrictionsImpl.Definition());
+            case "enumeration":
+                return new StatementDefinitionContext<>(new EnumSpecificationImpl.Definition());
+            case "leafref":
+                return new StatementDefinitionContext<>(new LeafrefSpecificationImpl.Definition());
+            case "bits":
+                return new StatementDefinitionContext<>(new BitsSpecificationImpl.Definition());
+            case "identityref":
+                return new StatementDefinitionContext<>(new IdentityRefSpecificationImpl.Definition());
+            case "instance-identifier":
+                return new StatementDefinitionContext<>(new InstanceIdentifierSpecificationImpl.Definition());
+            default:
+                return null;
+        }
+    }
+
+
     private PrefixToModule prefixes() {
         Map<String, QNameModule> prefixes = (Map<String, QNameModule>) currentContext.getAllFromNamespace(PrefixToModule.class);
         for (Map.Entry<String, QNameModule> prefix : prefixes.entrySet()) {
index 808518d9d84b4b58c5c858c0c4aaaea36364f86c..7a8d13031b944a9b519aea69b2d1f4b8bf63484d 100644 (file)
@@ -27,7 +27,6 @@ class SubstatementContext<A,D extends DeclaredStatement<A>, E extends EffectiveS
     private final A argument;
 
     SubstatementContext(StatementContextBase<?,?,?> parent,ContextBuilder<A,D,E> builder) throws SourceException {
-        //super(builder,  builder.getDefinition().parseArgumentValue(parent, builder.getRawArgument()));
         super(builder);
         this.parent = Preconditions.checkNotNull(parent, "Parent must not be null");
         this.argument =   builder.getDefinition().parseArgumentValue(this, builder.getRawArgument());
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BinarySpecificationImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BinarySpecificationImpl.java
new file mode 100644 (file)
index 0000000..dcc57ab
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
+
+import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.LengthStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+public class BinarySpecificationImpl extends AbstractDeclaredStatement<String> implements TypeStatement.BinarySpecification {
+
+    protected BinarySpecificationImpl(StmtContext<String, ?, ?> context) {
+        super(context);
+    }
+
+    public static class Definition extends AbstractStatementSupport<String, BinarySpecification, EffectiveStatement<String, BinarySpecification>> {
+
+        public Definition() {
+            super(Rfc6020Mapping.TYPE);
+        }
+
+        @Override
+        public String parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException {
+            return value;
+        }
+
+        @Override
+        public BinarySpecification createDeclared(StmtContext<String, BinarySpecification, ?> ctx) {
+            return new BinarySpecificationImpl(ctx);
+        }
+
+        @Override
+        public EffectiveStatement<String, BinarySpecification> createEffective(StmtContext<String, BinarySpecification, EffectiveStatement<String, BinarySpecification>> ctx) {
+            return null;
+        }
+    }
+
+    @Nullable
+    @Override
+    public LengthStatement getLength() {
+        return firstDeclared(LengthStatement.class);
+    }
+
+    @Nonnull
+    @Override
+    public String getName() {
+        return argument();
+    }
+}
index 93e227ac00c80ac80a8398f336b8b4e783a155e5..f2831bfd30aa5d6e6c35558bd06bdce559c35dd4 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -28,9 +28,7 @@ public class BitStatementImpl extends AbstractDeclaredStatement<String>
         super(context);
     }
 
-    public static class Definition
-            extends
-            AbstractStatementSupport<String, BitStatement, EffectiveStatement<String, BitStatement>> {
+    public static class Definition extends AbstractStatementSupport<String, BitStatement, EffectiveStatement<String, BitStatement>> {
 
         public Definition() {
             super(Rfc6020Mapping.BIT);
index 53215e76f72df5de239caf31ff6189b8d7ae3f26..5138e0b22538ce185f305cc0e7b3a8539d37065b 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,6 +17,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.BitsSpecificationEffectiveStatementImpl;
 
 public class BitsSpecificationImpl extends AbstractDeclaredStatement<String>
         implements TypeStatement.BitsSpecification {
@@ -49,7 +50,7 @@ public class BitsSpecificationImpl extends AbstractDeclaredStatement<String>
         @Override
         public EffectiveStatement<String, TypeStatement.BitsSpecification> createEffective(
                 StmtContext<String, TypeStatement.BitsSpecification, EffectiveStatement<String, TypeStatement.BitsSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new BitsSpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 985b18d1a0f9074c28a0351adef8932a93d4d6f1..15d91a4d144c16b0e04507c2815625ef5f8dc1b2 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -8,7 +8,6 @@
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
 import org.opendaylight.yangtools.yang.model.api.stmt.FractionDigitsStatement;
-
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
@@ -17,6 +16,7 @@ import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.RangeStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.Decimal64SpecificationEffectiveStatementImpl;
 
 public class Decimal64SpecificationImpl extends AbstractDeclaredStatement<String> implements TypeStatement.Decimal64Specification{
 
@@ -27,7 +27,7 @@ public class Decimal64SpecificationImpl extends AbstractDeclaredStatement<String
     public static class Definition extends AbstractStatementSupport<String,TypeStatement.Decimal64Specification,EffectiveStatement<String,TypeStatement.Decimal64Specification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.FRACTION_DIGITS);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override public String parseArgumentValue(StmtContext<?, ?, ?> ctx,
@@ -42,7 +42,7 @@ public class Decimal64SpecificationImpl extends AbstractDeclaredStatement<String
 
         @Override public EffectiveStatement<String, TypeStatement.Decimal64Specification> createEffective(
                 StmtContext<String, TypeStatement.Decimal64Specification, EffectiveStatement<String, TypeStatement.Decimal64Specification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new Decimal64SpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 8a1a9738e3e50d8fa6cde10279efa2e4e526a435..f56e9a4739b4a72d26409784bc4415a0d150f0ae 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,6 +17,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EnumSpecificationEffectiveStatementImpl;
 
 public class EnumSpecificationImpl extends AbstractDeclaredStatement<String>
         implements TypeStatement.EnumSpecification {
@@ -31,7 +32,7 @@ public class EnumSpecificationImpl extends AbstractDeclaredStatement<String>
             AbstractStatementSupport<String, TypeStatement.EnumSpecification, EffectiveStatement<String, TypeStatement.EnumSpecification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.ENUM);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override
@@ -49,7 +50,7 @@ public class EnumSpecificationImpl extends AbstractDeclaredStatement<String>
         @Override
         public EffectiveStatement<String, TypeStatement.EnumSpecification> createEffective(
                 StmtContext<String, TypeStatement.EnumSpecification, EffectiveStatement<String, TypeStatement.EnumSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new EnumSpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 3fa1b1ce7f303e8e00c191d101cafbe12d6493c1..7c5ae5a58799e881a0d3c0eea920a3f64dae07c6 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
index e3ff0d39fb7a3092fc9b6e062ac8c95252eb904c..e7bebeee0e14a2b638073fdd89dd5c4a90a160c7 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
 import org.opendaylight.yangtools.yang.parser.spi.ExtensionNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
-import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
@@ -51,7 +50,7 @@ public class ExtensionStatementImpl extends AbstractDeclaredStatement<QName> imp
         }
 
         @Override
-        public void onStatementDefinitionDeclared(final StmtContext.Mutable<QName, ExtensionStatement, EffectiveStatement<QName, ExtensionStatement>> stmt) throws InferenceException, SourceException {
+        public void onStatementDefinitionDeclared(final StmtContext.Mutable<QName, ExtensionStatement, EffectiveStatement<QName, ExtensionStatement>> stmt) throws SourceException {
             stmt.addContext(ExtensionNamespace.class, stmt.getStatementArgument(), stmt);
         }
     }
index 30d6ef0769c46e933d3bf28edf829299c98469eb..98a5667df0375d96fbf5097bcc80e929f24aa553 100644 (file)
@@ -60,9 +60,10 @@ public class GroupingStatementImpl extends AbstractDeclaredStatement<QName>
         }
 
         @Override
-        public void onFullDefinitionDeclared(
-                Mutable<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> stmt) throws SourceException {
-            stmt.getParentContext().addContext(GroupingNamespace.class, stmt.getStatementArgument(),stmt);
+        public void onFullDefinitionDeclared(Mutable<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> stmt) throws SourceException {
+            if (stmt != null && stmt.getParentContext() != null) {
+                stmt.getParentContext().addContext(GroupingNamespace.class, stmt.getStatementArgument(), stmt);
+            }
         }
 
     }
index bd2b1e7c0a67a5a05fdcd86f7073d5b93697edc8..37df53b9b6b34d91061d6e24781859bcbd9fc746 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -7,6 +7,11 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
+import com.google.common.base.Preconditions;
+import org.opendaylight.yangtools.yang.model.api.stmt.BaseStatement;
+import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
@@ -14,10 +19,13 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.IdentityRefSpecificationEffectiveStatementImpl;
 
-public class IdentityRefSpecificationImpl extends
-        AbstractDeclaredStatement<String> implements
-        TypeStatement.IdentityRefSpecification {
+import javax.annotation.Nonnull;
+import java.util.Map;
+
+public class IdentityRefSpecificationImpl extends AbstractDeclaredStatement<String> implements TypeStatement.IdentityRefSpecification {
 
     protected IdentityRefSpecificationImpl(
             StmtContext<String, TypeStatement.IdentityRefSpecification, ?> context) {
@@ -29,7 +37,7 @@ public class IdentityRefSpecificationImpl extends
             AbstractStatementSupport<String, TypeStatement.IdentityRefSpecification, EffectiveStatement<String, TypeStatement.IdentityRefSpecification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.BASE);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override
@@ -47,7 +55,14 @@ public class IdentityRefSpecificationImpl extends
         @Override
         public EffectiveStatement<String, TypeStatement.IdentityRefSpecification> createEffective(
                 StmtContext<String, TypeStatement.IdentityRefSpecification, EffectiveStatement<String, TypeStatement.IdentityRefSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new IdentityRefSpecificationEffectiveStatementImpl(ctx);
+        }
+
+        @Override
+        public void onFullDefinitionDeclared(StmtContext.Mutable<String, IdentityRefSpecification, EffectiveStatement<String, IdentityRefSpecification>> stmt) throws SourceException {
+            //FIXME:
+//            StatementContextBase<?, ?, ?> stmtCtx = (StatementContextBase<?, ?, ?>) stmt.getFromNamespace(IdentityNamespace.class, Utils.qNameFromArgument(StmtContextUtils.findFirstDeclaredSubstatement(stmt, BaseStatement.class), (String) StmtContextUtils.findFirstDeclaredSubstatement(stmt, BaseStatement.class).getStatementArgument()));
+//            Preconditions.checkArgument(stmtCtx != null, "Identity '%s' doesn't exist in given scope (module, imported submodules)", stmt.getStatementArgument());
         }
     }
 
@@ -56,4 +71,10 @@ public class IdentityRefSpecificationImpl extends
         return argument();
     }
 
+    @Nonnull
+    @Override
+    public BaseStatement getBase() {
+        return firstDeclared(BaseStatement.class);
+    }
+
 }
index 092cc411e3a5bc64fa0c7c7c0e4ea4bf983fd16b..ada4c730958c2aa93e5ab42498c479d41eaea486 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -7,8 +7,11 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
+import org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParser;
+import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.IdentityEffectiveStatementImpl;
-
 import org.opendaylight.yangtools.yang.model.api.stmt.BaseStatement;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
@@ -29,9 +32,7 @@ public class IdentityStatementImpl extends AbstractDeclaredStatement<QName>
         super(context);
     }
 
-    public static class Definition
-            extends
-            AbstractStatementSupport<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> {
+    public static class Definition extends AbstractStatementSupport<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> {
 
         public Definition() {
             super(Rfc6020Mapping.IDENTITY);
@@ -54,6 +55,10 @@ public class IdentityStatementImpl extends AbstractDeclaredStatement<QName>
             return new IdentityEffectiveStatementImpl(ctx);
         }
 
+        @Override
+        public void onStatementDefinitionDeclared(final StmtContext.Mutable<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> stmt) throws SourceException {
+            stmt.addToNs(IdentityNamespace.class, stmt.getStatementArgument(), stmt);
+        }
     }
 
     @Override
index 504498db3479e701221e00702e8c06b16fe4b4a1..d51ae869ac2f276bd03668d8b122923f232f36aa 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,6 +16,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.InstanceIdentifierSpecificationEffectiveStatementImpl;
 
 public class InstanceIdentifierSpecificationImpl extends
         AbstractDeclaredStatement<String> implements
@@ -31,7 +32,7 @@ public class InstanceIdentifierSpecificationImpl extends
             AbstractStatementSupport<String, TypeStatement.InstanceIdentifierSpecification, EffectiveStatement<String, TypeStatement.InstanceIdentifierSpecification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.REQUIRE_INSTANCE);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override
@@ -49,7 +50,7 @@ public class InstanceIdentifierSpecificationImpl extends
         @Override
         public EffectiveStatement<String, TypeStatement.InstanceIdentifierSpecification> createEffective(
                 StmtContext<String, TypeStatement.InstanceIdentifierSpecification, EffectiveStatement<String, TypeStatement.InstanceIdentifierSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new InstanceIdentifierSpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 58b7d5cacf3c475aaa755148624cc5b6c45fa566..d01ed15de3218bc90038bdd8524078333f6c4931 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -8,7 +8,6 @@
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
 import org.opendaylight.yangtools.yang.model.api.stmt.PathStatement;
-
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
@@ -16,6 +15,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.LeafrefSpecificationEffectiveStatementImpl;
 
 public class LeafrefSpecificationImpl extends AbstractDeclaredStatement<String>
         implements TypeStatement.LeafrefSpecification {
@@ -30,7 +30,7 @@ public class LeafrefSpecificationImpl extends AbstractDeclaredStatement<String>
             AbstractStatementSupport<String, TypeStatement.LeafrefSpecification, EffectiveStatement<String, TypeStatement.LeafrefSpecification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.PATH);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override
@@ -48,7 +48,7 @@ public class LeafrefSpecificationImpl extends AbstractDeclaredStatement<String>
         @Override
         public EffectiveStatement<String, TypeStatement.LeafrefSpecification> createEffective(
                 StmtContext<String, TypeStatement.LeafrefSpecification, EffectiveStatement<String, TypeStatement.LeafrefSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new LeafrefSpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 5df5575050d930ef3383899b2a54b87ce3ff4e6e..0db8c69f4105c4d6875be7cda19b769e2d644cc3 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.MustEffectiveStatementImpl;
@@ -34,7 +41,7 @@ public class MustStatementImpl extends AbstractDeclaredStatement<RevisionAwareXP
 
         @Override public RevisionAwareXPath parseArgumentValue(
                 StmtContext<?, ?, ?> ctx, String value) throws SourceException {
-            return new RevisionAwareXPathImpl(value, false);
+            return new RevisionAwareXPathImpl(value, Utils.isXPathAbsolute(value));
         }
 
         @Override public MustStatement createDeclared(
index 2415db62d8f19319f5477331ac374299d45a6fc5..bcf5b34962aa42a8173656a81c4d8462d91de773 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.RangeStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.NumericalRestrictionsEffectiveStatementImpl;
 
 public class NumericalRestrictionsImpl extends AbstractDeclaredStatement<String> implements TypeStatement.NumericalRestrictions{
 
@@ -25,7 +26,7 @@ public class NumericalRestrictionsImpl extends AbstractDeclaredStatement<String>
     public static class Definition extends AbstractStatementSupport<String,TypeStatement.NumericalRestrictions,EffectiveStatement<String,TypeStatement.NumericalRestrictions>> {
 
         public Definition() {
-            super(Rfc6020Mapping.RANGE);
+            super(Rfc6020Mapping.TYPE);
         }
 
         @Override public String parseArgumentValue(StmtContext<?, ?, ?> ctx,
@@ -40,7 +41,7 @@ public class NumericalRestrictionsImpl extends AbstractDeclaredStatement<String>
 
         @Override public EffectiveStatement<String, TypeStatement.NumericalRestrictions> createEffective(
                 StmtContext<String, TypeStatement.NumericalRestrictions, EffectiveStatement<String, TypeStatement.NumericalRestrictions>> ctx) {
-            throw new UnsupportedOperationException();
+            return new NumericalRestrictionsEffectiveStatementImpl(ctx);
         }
     }
 
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/PathStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/PathStatementImpl.java
new file mode 100644 (file)
index 0000000..d0bc47e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
+
+import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.ErrorAppTagStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.ErrorMessageStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.MustStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.PathStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
+import org.opendaylight.yangtools.yang.model.util.RevisionAwareXPathImpl;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.MustEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.PathEffectiveStatementImpl;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+public class PathStatementImpl extends AbstractDeclaredStatement<RevisionAwareXPath> implements
+        PathStatement {
+
+    protected PathStatementImpl(StmtContext<RevisionAwareXPath, PathStatement, ?> context) {
+        super(context);
+    }
+
+    public static class Definition extends AbstractStatementSupport<RevisionAwareXPath,PathStatement,EffectiveStatement<RevisionAwareXPath,PathStatement>> {
+
+        public Definition() {
+            super(Rfc6020Mapping.PATH);
+        }
+
+        @Override public RevisionAwareXPath parseArgumentValue(
+                StmtContext<?, ?, ?> ctx, String value) throws SourceException {
+            return new RevisionAwareXPathImpl(value, Utils.isXPathAbsolute(value));
+        }
+
+        @Override public PathStatement createDeclared(
+                StmtContext<RevisionAwareXPath, PathStatement, ?> ctx) {
+            return new PathStatementImpl(ctx);
+        }
+
+        @Override public EffectiveStatement<RevisionAwareXPath, PathStatement> createEffective(
+                StmtContext<RevisionAwareXPath, PathStatement, EffectiveStatement<RevisionAwareXPath, PathStatement>> ctx) {
+           return new PathEffectiveStatementImpl(ctx);
+        }
+    }
+
+    @Nonnull
+    @Override
+    public String getValue() {
+        return rawArgument();
+    }
+
+}
index 0573fc310d25da9303390f040ba257ba1f873a2c..cd192b9f9ae345a61bdb64417cbb9cbd3ad80491 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
index 7a85c177787394d17f1e0602ec275100c4fdcb04..0a9cfffcb42ea32206d93db9ca907c1424f4b445 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -18,6 +18,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.StringRestrictionsEffectiveStatementImpl;
 
 public class StringRestrictionsImpl extends AbstractDeclaredStatement<String>
         implements TypeStatement.StringRestrictions {
@@ -50,7 +51,7 @@ public class StringRestrictionsImpl extends AbstractDeclaredStatement<String>
         @Override
         public EffectiveStatement<String, TypeStatement.StringRestrictions> createEffective(
                 StmtContext<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> ctx) {
-            throw new UnsupportedOperationException();
+            return new StringRestrictionsEffectiveStatementImpl(ctx);
         }
     }
 
index e96db5e9d836c284cb7b1409853891d70bc9635e..6f87836f94ba0529c8c8cecfe23bcdeef6594f38 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -7,13 +7,18 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.util.BaseTypes;
+import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.TypeEffectiveStatementImpl;
 
 import javax.annotation.Nonnull;
 
@@ -41,7 +46,17 @@ public class TypeStatementImpl extends AbstractDeclaredStatement<String> impleme
 
         @Override public EffectiveStatement<String, TypeStatement> createEffective(
                 StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
-            throw new UnsupportedOperationException();
+            return new TypeEffectiveStatementImpl(ctx);
+        }
+
+        @Override
+        public void onFullDefinitionDeclared(StmtContext.Mutable<String, TypeStatement, EffectiveStatement<String, TypeStatement>> stmt) throws SourceException {
+            if (!BaseTypes.isYangBuildInType(stmt.getStatementArgument())) {
+                if (stmt.getParentContext() != null) {
+                    StatementContextBase<?, ?, ?> stmtCtx = (StatementContextBase<?, ?, ?>) stmt.getParentContext().getFromNamespace(TypeNamespace.class, Utils.qNameFromArgument(stmt, stmt.getStatementArgument()));
+                    Preconditions.checkArgument(stmtCtx != null, "Typedef '%s' doesn't exist in given scope", stmt.getStatementArgument());
+                }
+            }
         }
     }
 
index 595c280e87109b6d05c519b2f878a3b20996c36b..96c87db15a000948ea5f9a68d05b7fa813685406 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,10 +17,13 @@ import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
+import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.TypeDefEffectiveStatementImpl;
+
 import javax.annotation.Nullable;
 
 public class TypedefStatementImpl extends AbstractDeclaredStatement<QName>
@@ -54,7 +57,14 @@ public class TypedefStatementImpl extends AbstractDeclaredStatement<QName>
         @Override
         public EffectiveStatement<QName, TypedefStatement> createEffective(
                 StmtContext<QName, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> ctx) {
-            throw new UnsupportedOperationException();
+            return new TypeDefEffectiveStatementImpl(ctx);
+        }
+
+        @Override
+        public void onStatementDefinitionDeclared(StmtContext.Mutable<QName, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> stmt) throws SourceException {
+            if (stmt != null && stmt.getParentContext() != null) {
+                stmt.getParentContext().addContext(TypeNamespace.class, stmt.getStatementArgument(), stmt);
+            }
         }
     }
 
index 36ca6f5854f1a6bf0dfb0d9b28d69e81aea7b744..22d00f0a686513dc1f6282a65b7c1863a8216d50 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -8,13 +8,15 @@
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
 import java.util.Collection;
+
+import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.UnionSpecificationEffectiveStatementImpl;
 
 public class UnionSpecificationImpl extends AbstractDeclaredStatement<String>
         implements TypeStatement.UnionSpecification {
@@ -24,9 +26,7 @@ public class UnionSpecificationImpl extends AbstractDeclaredStatement<String>
         super(context);
     }
 
-    public static class Definition
-            extends
-            AbstractStatementSupport<String, TypeStatement.UnionSpecification, EffectiveStatement<String, TypeStatement.UnionSpecification>> {
+    public static class Definition extends AbstractStatementSupport<String, TypeStatement.UnionSpecification, EffectiveStatement<String, TypeStatement.UnionSpecification>> {
 
         public Definition() {
             super(Rfc6020Mapping.TYPE);
@@ -47,7 +47,7 @@ public class UnionSpecificationImpl extends AbstractDeclaredStatement<String>
         @Override
         public EffectiveStatement<String, TypeStatement.UnionSpecification> createEffective(
                 StmtContext<String, TypeStatement.UnionSpecification, EffectiveStatement<String, TypeStatement.UnionSpecification>> ctx) {
-            throw new UnsupportedOperationException();
+            return new UnionSpecificationEffectiveStatementImpl(ctx);
         }
     }
 
index 7e5fc5646ff568a760f622c523021f84857a1576..78d60b19326d513d136ef31e525b3a21ab53fa42 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -39,7 +39,7 @@ public class WhenStatementImpl extends AbstractDeclaredStatement<RevisionAwareXP
 
         @Override public RevisionAwareXPath parseArgumentValue(
                 StmtContext<?, ?, ?> ctx, String value) throws SourceException {
-            return new RevisionAwareXPathImpl(value, false);
+            return new RevisionAwareXPathImpl(value, Utils.isXPathAbsolute(value));
         }
 
         @Override public WhenStatement createDeclared(
index 87bfe2b3f4f9bb5cbf5cd261cebcfcb7876057db..29fddc0b1cf6f64ca0f5cda434c1d54f4f5e2e8c 100644 (file)
@@ -12,6 +12,8 @@ import static org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour
 import static org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.treeScoped;
 
 import org.opendaylight.yangtools.yang.parser.spi.ExtensionNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.source.ModuleQNameToModuleName;
 
 import org.opendaylight.yangtools.yang.parser.spi.source.PrefixToModule;
@@ -27,7 +29,6 @@ import org.opendaylight.yangtools.yang.parser.spi.ModuleNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.NamespaceToModule;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupportBundle;
-import org.opendaylight.yangtools.yang.parser.spi.source.QNameToStatementDefinition;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
 
 public final class YangInferencePipeline {
@@ -58,7 +59,6 @@ public final class YangInferencePipeline {
             .addSupport(sourceLocal(IncludedModuleContext.class))
             .addSupport(sourceLocal(ImpPrefixToModuleIdentifier.class))
             .addSupport(sourceLocal(BelongsToPrefixToModuleName.class))
-            .addSupport(sourceLocal(QNameToStatementDefinition.class))
             .build();
 
     private static final StatementSupportBundle STMT_DEF_BUNDLE = StatementSupportBundle.
@@ -67,6 +67,10 @@ public final class YangInferencePipeline {
             .addSupport(new ArgumentStatementImpl.Definition())
             .addSupport(new ExtensionStatementImpl.Definition())
             .addSupport(global(ExtensionNamespace.class))
+            .addSupport(new TypedefStatementImpl.Definition())
+            .addSupport(treeScoped(TypeNamespace.class))
+            .addSupport(new IdentityStatementImpl.Definition())
+            .addSupport(global(IdentityNamespace.class))
             .build();
 
     private static final StatementSupportBundle FULL_DECL_BUNDLE = StatementSupportBundle.
@@ -82,7 +86,6 @@ public final class YangInferencePipeline {
             .addSupport(new DefaultStatementImpl.Definition())
             .addSupport(new MustStatementImpl.Definition())
             .addSupport(new MandatoryStatementImpl.Definition())
-            .addSupport(new TypedefStatementImpl.Definition())
             .addSupport(new AnyxmlStatementImpl.Definition())
             .addSupport(new IfFeatureStatementImpl.Definition())
             .addSupport(new UsesStatementImpl.Definition())
@@ -101,7 +104,6 @@ public final class YangInferencePipeline {
             .addSupport(new WhenStatementImpl.Definition())
             .addSupport(new AugmentStatementImpl.Definition())
             .addSupport(new RefineStatementImpl.Definition())
-            .addSupport(new IdentityStatementImpl.Definition())
             .addSupport(new BaseStatementImpl.Definition())
             .addSupport(new FractionDigitsStatementImpl.Definition())
             .addSupport(new EnumStatementImpl.Definition())
@@ -117,16 +119,8 @@ public final class YangInferencePipeline {
             .addSupport(new ValueStatementImpl.Definition())
             .addSupport(new UnitsStatementImpl.Definition())
             .addSupport(new RequireInstanceStatementImpl.Definition())
-            //TODO: add mapping to Rfc6020Mapping class and uncomment following. Please test it.
-//            .addSupport(new EnumSpecificationImpl.Definition())
-//            .addSupport(new Decimal64SpecificationImpl.Definition())
-//            .addSupport(new IdentityRefSpecificationImpl.Definition())
-//            .addSupport(new InstanceIdentifierSpecificationImpl.Definition())
-//            .addSupport(new LeafrefSpecificationImpl.Definition())
-//            .addSupport(new NumericalRestrictionsImpl.Definition())
-//            .addSupport(new StringRestrictionsImpl.Definition())
-//            .addSupport(new UnionSpecificationImpl.Definition())
-//            .addSupport(new BitStatementImpl.Definition())
+            .addSupport(new BitStatementImpl.Definition())
+            .addSupport(new PathStatementImpl.Definition())
             .build();
 
     public static final Map<ModelProcessingPhase, StatementSupportBundle> RFC6020_BUNDLES = ImmutableMap
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/BitsSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/BitsSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..36ad297
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class BitsSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.BitsSpecification> {
+
+    public BitsSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.BitsSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/Decimal64SpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/Decimal64SpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..8d367a4
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class Decimal64SpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.Decimal64Specification> {
+
+    public Decimal64SpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.Decimal64Specification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/EnumSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/EnumSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..c94c79f
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class EnumSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.EnumSpecification> {
+
+    public EnumSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.EnumSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/IdentityRefSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/IdentityRefSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..f06597a
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class IdentityRefSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.IdentityRefSpecification> {
+
+    public IdentityRefSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.IdentityRefSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/InstanceIdentifierSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/InstanceIdentifierSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..68c3476
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class InstanceIdentifierSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.InstanceIdentifierSpecification> {
+
+    public InstanceIdentifierSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.InstanceIdentifierSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/LeafrefSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/LeafrefSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..15b36dd
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class LeafrefSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.LeafrefSpecification> {
+
+    public LeafrefSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.LeafrefSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/NumericalRestrictionsEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/NumericalRestrictionsEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..98c6dcd
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class NumericalRestrictionsEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.NumericalRestrictions> {
+
+    public NumericalRestrictionsEffectiveStatementImpl(StmtContext<String, TypeStatement.NumericalRestrictions, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/PathEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/PathEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..5fa69b0
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.PathStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class PathEffectiveStatementImpl extends
+        EffectiveStatementBase<RevisionAwareXPath, PathStatement> {
+
+    public PathEffectiveStatementImpl(
+            StmtContext<RevisionAwareXPath, PathStatement, ?> ctx) {
+        super(ctx);
+
+    }
+
+}
\ No newline at end of file
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/StringRestrictionsEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/StringRestrictionsEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..139a7d4
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class StringRestrictionsEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.StringRestrictions> {
+
+    public StringRestrictionsEffectiveStatementImpl(StmtContext<String, TypeStatement.StringRestrictions, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeDefEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeDefEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..05070c0
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class TypeDefEffectiveStatementImpl extends EffectiveStatementBase<QName, TypedefStatement> {
+
+    public TypeDefEffectiveStatementImpl(StmtContext<QName, TypedefStatement, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/TypeEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..b627725
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class TypeEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement> {
+
+    public TypeEffectiveStatementImpl(StmtContext<String, TypeStatement, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/UnionSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/UnionSpecificationEffectiveStatementImpl.java
new file mode 100644 (file)
index 0000000..12b8ba9
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+
+public class UnionSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement.UnionSpecification> {
+
+    public UnionSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.UnionSpecification, ?> ctx) {
+        super(ctx);
+    }
+}
diff --git a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/YangTypesStmtTest.java b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/YangTypesStmtTest.java
new file mode 100644 (file)
index 0000000..68fd50f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.stmt.test;
+
+import org.junit.Test;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
+
+import static org.junit.Assert.assertNotNull;
+
+public class YangTypesStmtTest {
+
+    private static final YangStatementSourceImpl TYPEFILE1 = new YangStatementSourceImpl("/semantic-statement-parser/types.yang");
+    private static final YangStatementSourceImpl TYPEFILE2 = new YangStatementSourceImpl("/semantic-statement-parser/simple-types.yang");
+
+    @Test
+    public void readAndParseYangFileTest() throws SourceException, ReactorException {
+        CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
+        addSources(reactor, TYPEFILE1, TYPEFILE2);
+        EffectiveModelContext result = reactor.build();
+        assertNotNull(result);
+    }
+
+    private void addSources(CrossSourceStatementReactor.BuildAction reactor, StatementStreamSource... sources) {
+        for (StatementStreamSource source : sources) {
+            reactor.addSource(source);
+        }
+    }
+}
diff --git a/yang/yang-parser-impl/src/test/resources/semantic-statement-parser/simple-types.yang b/yang/yang-parser-impl/src/test/resources/semantic-statement-parser/simple-types.yang
new file mode 100644 (file)
index 0000000..30d0b13
--- /dev/null
@@ -0,0 +1,103 @@
+module simple-types {
+
+    yang-version 1;
+    namespace "urn:simple.types";
+    prefix "st";
+
+    organization "opendaylight";
+    contact "WILL-BE-DEFINED-LATER";
+    revision 2015-04-16;
+
+    typedef myint8 {
+        type int8 {
+            range "1..20";
+        }
+    }
+
+    identity my-base;
+
+    typedef myint32 {
+         type int32 {
+            range "1..2000";
+         }
+    }
+
+    container mycontainer {
+       leaf mynumerical {
+          type int32 {
+            range "1..3000";
+          }
+       }
+
+       leaf mynorestrictions {
+           type string;
+       }
+
+       leaf mytypedefuse1 {
+           type myint32;
+       }
+
+       leaf mytypedefuse2 {
+           type myint8;
+       }
+
+        leaf myunion {
+            type union {
+                type int8;
+                type int32;
+            }
+        }
+
+        leaf mydecimal64 {
+            type decimal64 {
+                fraction-digits 2;
+                range "1 .. 3.14 | 10 | 20..max";
+            }
+        }
+
+        leaf mystring {
+            type string {
+                length "1..255";
+                pattern "[0-9a-fA-F]*";
+            }
+        }
+
+        leaf myenum {
+            type enumeration {
+                enum zero;
+                enum one;
+                enum seven {
+                    value 7;
+                }
+            }
+        }
+
+        leaf mybits {
+            type bits {
+                bit disable-nagle {
+                    position 0;
+                }
+                bit auto-sense-speed {
+                    position 1;
+                }
+                bit 10-Mb-only {
+                    position 2;
+                }
+            }
+            default "auto-sense-speed";
+        }
+
+        leaf mgmt-interface {
+            type leafref {
+               path "../myenum";
+            }
+        }
+
+        leaf crypto {
+            type identityref {
+                base "my-base";
+            }
+        }
+
+    }
+}
diff --git a/yang/yang-parser-impl/src/test/resources/semantic-statement-parser/types.yang b/yang/yang-parser-impl/src/test/resources/semantic-statement-parser/types.yang
new file mode 100644 (file)
index 0000000..eff282a
--- /dev/null
@@ -0,0 +1,132 @@
+module custom-types-test {
+
+    yang-version 1;
+    namespace "urn:custom.types.demo";
+    prefix "iit";
+
+    organization "opendaylight";
+    contact "WILL-BE-DEFINED-LATER";
+        revision 2012-04-16 {
+    }
+
+    extension mountpoint {
+        description "enter point";
+        argument "name" {
+            yin-element "true";
+        }
+    }
+
+    typedef access-operations-type {
+        type bits {
+            bit create {
+                description "Any protocol operation that creates a new data node.";
+            }
+            bit read {
+                description "Any protocol operation or notification that returns the value of a data node.";
+                position 500;
+            }
+            bit update {
+                description "Any protocol operation that alters an existing data node.";
+            }
+            bit delete {
+                description "Any protocol operation that removes a data node.";
+                position 365;
+            }
+            bit exec {
+                description "Execution access to the specified protocol operation.";
+            }
+        }
+        description "NETCONF Access Operation.";
+    }
+
+    leaf inst-id-leaf1 {
+        type instance-identifier {
+            require-instance false;
+        }
+        iit:mountpoint "mnt-extension";
+    }
+
+    leaf inst-id-leaf2 {
+        type instance-identifier;
+    }
+
+    leaf type {
+        type service-type-ref;
+    }
+
+    identity crypto-id {
+        base "crypto-base";
+        description "crypto-id description";
+        iit:mountpoint "mnt-extension";
+    }
+
+    identity crypto-base {
+        description "crypto-base description";
+    }
+
+    identity crypto-alg {
+        base "crypto-base";
+        description "crypto-alg description";
+    }
+
+    identity crypto-def {
+        base "crypto-base";
+        description "crypto-def description";
+    }
+
+    leaf mybits {
+        type bits {
+            bit disable-nagle {
+                position 0;
+            }
+            bit auto-sense-speed {
+                position 1;
+            }
+            bit 10-Mb-only {
+                position 2;
+            }
+        }
+        default "auto-sense-speed";
+    }
+
+    typedef ip-version {
+        type enumeration {
+            enum unknown {
+                description "An unknown or unspecified version of the Internet protocol.";
+            }
+            enum ipv4 {
+                value "19";
+                description "The IPv4 protocol as defined in RFC 791.";
+            }
+            enum ipv6 {
+                value "7";
+                description "The IPv6 protocol as defined in RFC 2460.";
+            }
+            enum default {
+                description "default ip";
+            }
+        }
+    }
+
+    identity service-type {
+        description
+            "Service identity base type. All service identities must be
+             derived from this type. A service type uniquely defines a single
+             atomic API contract, such as a Java interface, a set of C
+             function declarations, or similar.
+
+             If the service type has a corresponding Java interface, the name
+             of that interface should be attached to the derived identity MUST
+             include a java-class keyword, whose name argument points to that
+             interface.";
+    }
+
+    typedef service-type-ref {
+        description
+            "Internal type of references to service type identity.";
+        type identityref {
+            base service-type;
+        }
+    }
+
+}