<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-spi</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-generator-impl</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-codec</artifactId>
<artifactId>yang-parser-impl</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-test-model</artifactId>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-codec</artifactId>
</dependency>
+ <dependency>
+ <!-- FIXME: MDSAL-392: this is ugly, we should be looking this up,
+ but then we may want to end up doing something
+ completely different in this artifact -->
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ </dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>byte-buddy</artifactId>
<version>1.10.7</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-generator-impl</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-dom-codec-api</artifactId>
+ <artifactId>mdsal-binding-generator-util</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-test-model</artifactId>
+ <artifactId>mdsal-binding-dom-codec-api</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>mockito-configuration</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-test-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.Callable;
+import org.opendaylight.mdsal.binding.generator.util.BaseYangTypes;
import org.opendaylight.mdsal.binding.spec.naming.BindingMapping;
-import org.opendaylight.mdsal.binding.yang.types.BaseYangTypes;
import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.mdsal.binding.generator.util.BaseYangTypes;
import org.opendaylight.mdsal.binding.model.api.AccessModifier;
import org.opendaylight.mdsal.binding.model.api.Constant;
import org.opendaylight.mdsal.binding.model.api.DefaultType;
import org.opendaylight.mdsal.binding.model.util.generated.type.builder.GeneratedPropertyBuilderImpl;
import org.opendaylight.mdsal.binding.spec.naming.BindingMapping;
import org.opendaylight.mdsal.binding.yang.types.AbstractTypeProvider;
-import org.opendaylight.mdsal.binding.yang.types.BaseYangTypes;
import org.opendaylight.mdsal.binding.yang.types.GroupingDefinitionDependencySort;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import java.util.TreeMap;
import java.util.regex.Pattern;
import org.opendaylight.mdsal.binding.generator.spi.TypeProvider;
+import org.opendaylight.mdsal.binding.generator.util.BaseYangTypes;
import org.opendaylight.mdsal.binding.model.api.AccessModifier;
import org.opendaylight.mdsal.binding.model.api.ConcreteType;
import org.opendaylight.mdsal.binding.model.api.Enumeration;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
+import org.opendaylight.mdsal.binding.generator.util.BaseYangTypes;
import org.opendaylight.mdsal.binding.model.api.ConcreteType;
import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
import org.opendaylight.mdsal.binding.model.api.Type;
import org.opendaylight.mdsal.binding.model.util.Types;
-import org.opendaylight.mdsal.binding.yang.types.BaseYangTypes;
public class BaseTypeProvider {
import java.util.List;
import org.junit.Test;
+import org.opendaylight.mdsal.binding.generator.util.BaseYangTypes;
import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
import org.opendaylight.mdsal.binding.model.api.Type;
-import org.opendaylight.mdsal.binding.yang.types.BaseYangTypes;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
* 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.mdsal.binding.yang.types;
+package org.opendaylight.mdsal.binding.generator.util;
import com.google.common.collect.ImmutableMap;
import java.math.BigDecimal;
* 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.mdsal.binding.yang.types;
+package org.opendaylight.mdsal.binding.generator.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
--- /dev/null
+module base-yang-types {
+ yang-version 1;
+ namespace "urn:opendaylight:org:test:base:yang:types";
+ prefix "tp";
+
+ organization "OPEN DAYLIGHT";
+ contact "http://www.opendaylight.org/";
+
+ description "This module contains definitions of all Yang base types.";
+
+ revision "2014-09-14" {
+ reference "Added yang-int8-restricted type.";
+ }
+
+ revision "2014-07-23" {
+ reference "Initial Revision.";
+ }
+
+ typedef yang-boolean {
+ type boolean;
+ }
+
+ typedef yang-empty {
+ type empty;
+ }
+
+ typedef yang-enumeration {
+ type enumeration {
+ enum a;
+ enum b;
+ }
+ }
+
+ typedef yang-int8 {
+ type int8;
+ }
+
+ typedef yang-int8-restricted {
+ type int8 {
+ range 1..100;
+ }
+ }
+
+ typedef yang-int16 {
+ type int16;
+ }
+
+ typedef yang-int32 {
+ type int32;
+ }
+
+ typedef yang-int64 {
+ type int64;
+ }
+
+ typedef yang-string {
+ type string;
+ }
+
+ typedef yang-decimal64 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+
+ typedef yang-uint8 {
+ type uint8;
+ }
+
+ typedef yang-uint16 {
+ type uint16;
+ }
+
+ typedef yang-uint32 {
+ type uint32;
+ }
+
+ typedef yang-uint64 {
+ type uint64;
+ }
+
+ typedef yang-union {
+ type union {
+ type int32;
+ type int16;
+ }
+ }
+
+ typedef yang-binary {
+ type binary;
+ }
+
+ typedef yang-bits {
+ type bits {
+ bit disable-nagle {
+ position 0;
+ }
+ bit auto-sense-speed {
+ position 1;
+ }
+ bit only-10-Mb {
+ position 2;
+ }
+ }
+ default "auto-sense-speed";
+ }
+
+ typedef yang-instance-identifier {
+ type instance-identifier;
+ }
+}
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-adapter</artifactId>