mdsal.git
10 years agoRemoved Export-Package declaration from maven-bundle-plugin. Fixed some maven warnings.
Martin Vitez [Fri, 20 Sep 2013 08:01:59 +0000 (10:01 +0200)]
Removed Export-Package declaration from maven-bundle-plugin. Fixed some maven warnings.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRefactored OSGi metadata declaration.
Martin Vitez [Thu, 19 Sep 2013 15:26:42 +0000 (17:26 +0200)]
Refactored OSGi metadata declaration.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed OSGi metadata for binding-generator-api module.
Martin Vitez [Thu, 19 Sep 2013 13:27:56 +0000 (15:27 +0200)]
Fixed OSGi metadata for binding-generator-api module.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded OSGi metadata to yangtools artifacts.
Martin Vitez [Tue, 17 Sep 2013 14:37:21 +0000 (16:37 +0200)]
Added OSGi metadata to yangtools artifacts.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Added RoutingContext annotation, updated InstanceIdentifier"
Tony Tkacik [Tue, 17 Sep 2013 13:51:55 +0000 (13:51 +0000)]
Merge "Added RoutingContext annotation, updated InstanceIdentifier"

10 years agoAdded RoutingContext annotation, updated InstanceIdentifier
Tony Tkacik [Tue, 17 Sep 2013 12:55:40 +0000 (14:55 +0200)]
Added RoutingContext annotation, updated InstanceIdentifier

Change-Id: I16b1c56d632bdc5b871fa4aa2f09dfbe229c85de
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "add getIntValue() method to EnumTemplate so that representing value can by...
Tony Tkacik [Tue, 17 Sep 2013 11:35:11 +0000 (11:35 +0000)]
Merge "add getIntValue() method to EnumTemplate so that representing value can by accessed"

10 years agoMerge "Test for some parts of RefineUtils class"
Martin Vitez [Tue, 17 Sep 2013 10:05:02 +0000 (10:05 +0000)]
Merge "Test for some parts of RefineUtils class"

10 years agoMerge "Test for class RefineHolder.java"
Martin Vitez [Tue, 17 Sep 2013 09:37:55 +0000 (09:37 +0000)]
Merge "Test for class RefineHolder.java"

10 years agoTest for some parts of RefineUtils class
Jozef Gloncak [Tue, 17 Sep 2013 07:37:36 +0000 (09:37 +0200)]
Test for some parts of RefineUtils class

The test class RefineTest was created.

Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoTest for class RefineHolder.java
Jozef Gloncak [Fri, 13 Sep 2013 07:01:42 +0000 (09:01 +0200)]
Test for class RefineHolder.java

+ test for identityref built-in YANG type
+ test for NodeWrappedType class
+ test for BitImpl was added
+ test for MustDefinitionImpl class

Change-Id: Ib64cbfafcc88a6de56b5a132736081a649f7d8e7
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoMerge "Refactored implementation of getBaseType method for yang built-in types."
Tony Tkacik [Tue, 17 Sep 2013 08:18:17 +0000 (08:18 +0000)]
Merge "Refactored implementation of getBaseType method for yang built-in types."

10 years agoMerge "Fixed inconsistencies in yang types method names."
Tony Tkacik [Tue, 17 Sep 2013 08:18:00 +0000 (08:18 +0000)]
Merge "Fixed inconsistencies in yang types method names."

10 years agoMerge "Bump version to 0.5.8-SNAPSHOT."
Tony Tkacik [Tue, 17 Sep 2013 08:17:48 +0000 (08:17 +0000)]
Merge "Bump version to 0.5.8-SNAPSHOT."

10 years agoRefactored implementation of getBaseType method for yang built-in types.
Martin Vitez [Mon, 16 Sep 2013 14:03:18 +0000 (16:03 +0200)]
Refactored implementation of getBaseType method for yang built-in types.

Method now returns null instead of reference to itself.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoadd getIntValue() method to EnumTemplate so that representing value can by accessed
Michal Rehak [Mon, 16 Sep 2013 13:08:01 +0000 (15:08 +0200)]
add getIntValue() method to EnumTemplate so that representing value can by accessed

Signed-off-by: Michal Rehak <mirehak@cisco.com>
10 years agoFixed inconsistencies in yang types method names.
Martin Vitez [Mon, 16 Sep 2013 11:43:34 +0000 (13:43 +0200)]
Fixed inconsistencies in yang types method names.

Different method names like getLengthStatements(), getLengthConstraints(), getLengths() were unified as getLengtConstraints(). Same with other get<constraint-type> method names.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBump version to 0.5.8-SNAPSHOT.
Martin Vitez [Mon, 16 Sep 2013 11:19:45 +0000 (13:19 +0200)]
Bump version to 0.5.8-SNAPSHOT.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoadd forValue(int) method to EnumTemplate so that enum items can be resolved by given...
Michal Rehak [Fri, 13 Sep 2013 03:36:43 +0000 (05:36 +0200)]
add forValue(int) method to EnumTemplate so that enum items can be resolved by given value

Signed-off-by: Michal Rehak <mirehak@cisco.com>
10 years agoTests for class BindingGeneratorUtil
Jozef Gloncak [Wed, 11 Sep 2013 10:39:35 +0000 (12:39 +0200)]
Tests for class BindingGeneratorUtil

+ methods with prefix 'parseTo' in class BindingGeneratorUtil were
refactored.

Change-Id: I7d93a3e73423305af6055d2e3cf5cd1266b073bb
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoMerge "changed builder generator"
Tony Tkacik [Wed, 11 Sep 2013 03:55:41 +0000 (03:55 +0000)]
Merge "changed builder generator"

10 years agoFixing sonar issues 4
Jozef Gloncak [Tue, 10 Sep 2013 06:23:14 +0000 (08:23 +0200)]
Fixing sonar issues 4

+ unit test Int8Test.java for Int8.java was added

Change-Id: Ia89f741fd46be332a8e212352798eff47eb6215c
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agochanged builder generator
Michal Rehak [Tue, 10 Sep 2013 05:14:15 +0000 (07:14 +0200)]
changed builder generator

now the private constructor of inner class accesses properties of wrapping class through getters

Signed-off-by: Michal Rehak <mirehak@cisco.com>
10 years agoFixing sonar issues 3
Jozef Gloncak [Wed, 4 Sep 2013 12:54:03 +0000 (14:54 +0200)]
Fixing sonar issues 3

Change-Id: I4331f6a3374dbb54e7bfa0856d8a3c166dff42a5
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoFixing sonar issues 2
Jozef Gloncak [Tue, 3 Sep 2013 13:25:13 +0000 (15:25 +0200)]
Fixing sonar issues 2

Change-Id: Iaec2a3f7a268eb446cd113d2a369786a68c9c48e
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoFixed resolution problems in Code Generator
Tony Tkacik [Tue, 3 Sep 2013 22:05:38 +0000 (15:05 -0700)]
Fixed resolution problems in Code Generator

Added sorting of modules by dependencies for code generator
Fixed search for parent modules

Change-Id: I9017e03937050487476eed73dafc72376b8bc4e5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed NPE regresion in augmentation handling.
Tony Tkacik [Tue, 3 Sep 2013 17:16:49 +0000 (10:16 -0700)]
Fixed NPE regresion in augmentation handling.

Added rollback to original handling if the class of augmentation
target is not already generated or registered in newly introduced
mapping between yang types and generated java binding specs.

Change-Id: I9d05e8ed0f6d6f2f3230a320e6eceb4463130ab0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixing sonar issues
Jozef Gloncak [Tue, 3 Sep 2013 06:25:53 +0000 (08:25 +0200)]
Fixing sonar issues

Change-Id: I228cead40f53adcf2f25785bb56b3bbd63a7b168
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoConverted BindingGenerator and ParserUtils to xtend
Tony Tkacik [Tue, 3 Sep 2013 04:23:28 +0000 (21:23 -0700)]
Converted BindingGenerator and ParserUtils to xtend

  - Fixed bug in findNode implementation methods,
    which lead to ignoring rpcs and notifications

Change-Id: Ifb16c9911a0d0dfb4a62e2986b8c1d2ae84e4b17
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMinor code refactoring in YangParserImpl.
Martin Vitez [Mon, 2 Sep 2013 11:46:03 +0000 (13:46 +0200)]
Minor code refactoring in YangParserImpl.

Removed setGroupingPath method from UsesNodeBuilder.
Fixed overriding managed version warning in yang-parser-impl/pom.xml
Un-ignored test in GeneratorJavaFileTest.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Added InstanceIdentifier to code generation"
Martin Vitez [Mon, 2 Sep 2013 06:45:06 +0000 (06:45 +0000)]
Merge "Added InstanceIdentifier to code generation"

10 years agoAdded InstanceIdentifier to code generation
Tony Tkacik [Fri, 30 Aug 2013 20:30:49 +0000 (13:30 -0700)]
Added InstanceIdentifier to code generation

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Added Layer 2 Types model"
Tony Tkacik [Thu, 29 Aug 2013 23:43:57 +0000 (23:43 +0000)]
Merge "Added Layer 2 Types model"

10 years agoAdded Layer 2 Types model
Tony Tkacik [Thu, 29 Aug 2013 20:45:18 +0000 (13:45 -0700)]
Added Layer 2 Types model

Change-Id: Ib250b44bea812a1d1b7900a2cf2567adeecd917b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded javadoc to generated types
Tony Tkacik [Mon, 26 Aug 2013 16:46:09 +0000 (18:46 +0200)]
Added javadoc to generated types

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded NotificationListener interfaces
Tony Tkacik [Fri, 23 Aug 2013 14:30:53 +0000 (16:30 +0200)]
Added NotificationListener interfaces

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed resolving of leafref types with relative xpath.
Martin Vitez [Fri, 23 Aug 2013 12:43:47 +0000 (14:43 +0200)]
Fixed resolving of leafref types with relative xpath.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated binding model
Tony Tkacik [Fri, 23 Aug 2013 07:30:57 +0000 (09:30 +0200)]
Updated binding model

 - Added properties to GeneratedType
 - Cleaned up implementation of Type Builders
 - renamed getExtends to getSuperType

Change-Id: I8c20747e346fb7b81c196b6405bc63ee28a86f08
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoUpdated code generation
Tony Tkacik [Thu, 22 Aug 2013 16:21:52 +0000 (18:21 +0200)]
Updated code generation

 - Clean up of templates
 - Added generation of copy constructors and parent class constructors

Change-Id: I92f72d68d8d417b991c5f40204a58ff6492cf1c8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoTest for nested union in typedef and leaf added.
Jozef Gloncak [Thu, 22 Aug 2013 12:46:24 +0000 (14:46 +0200)]
Test for nested union in typedef and leaf added.

- BitAndUnionTOEnclosingTest class was rewritten
- MethodSignaturePattern renamed to NameTypePattern
- bit_and_union_in_leaf.yang was changed and renamed to bit_and_union.yang

Change-Id: Ib5b158d90ab2f2f5e5b121484cb7aad07b271e46
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoAdded Augmentable interface to RPC inputs / outputs
Tony Tkacik [Thu, 22 Aug 2013 13:51:37 +0000 (15:51 +0200)]
Added Augmentable interface to RPC inputs / outputs

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoReduced cyclomatic complexity by using Preconditions
Tony Tkacik [Thu, 22 Aug 2013 10:44:52 +0000 (12:44 +0200)]
Reduced cyclomatic complexity by using Preconditions

Change-Id: Id267a876829d28f3359c1f2c3209d43ccbaa81bc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Code refactoring"
Tony Tkacik [Thu, 22 Aug 2013 10:02:25 +0000 (10:02 +0000)]
Merge "Code refactoring"

10 years agoCode refactoring
Jozef Gloncak [Tue, 20 Aug 2013 14:06:31 +0000 (16:06 +0200)]
Code refactoring

-> the method provideGeneratedTOBuildersForUnionTypeDef in
TypeProviderImpl.java was refactored. New code wrapping methods were
addded:
--> resolveUnionSubtypeAsUnion
--> resolveExtendedSubtypeAsUnion
--> findGenTO
--> storeGenTO
and helper method
--> provideAvailableNameForGenTOBuilder

-> the method updateEnumPairsFromEnumTypeDef (next as new method) was added to
EnumerationBuilderImpl.java
-> the method updateEnumPairsFromEnumTypeDef in TypeProviderImpl was
replaced with new method
-> piece of code in method resolveInnerEnumFromTypeDefinition in
BindingGeneratorImpl with new method

Change-Id: Iea389ac83d3eb2252cf4789b356c65d272a4a9ad
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoRefactored base yang-java types.
Martin Vitez [Wed, 21 Aug 2013 12:56:55 +0000 (14:56 +0200)]
Refactored base yang-java types.

Updated types resolving in parser. Removed unused methods. Updated tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoComments of source code.
Jozef Gloncak [Thu, 15 Aug 2013 14:03:34 +0000 (16:03 +0200)]
Comments of source code.
Comments were added to files:
- BindingGeneratorImpl.java
- BaseYangTypes.java
- GroupingDefinitionDependencySort.java
- NodeWrappedType.java
- TypeProviderImpl.java
- UnionDependencySort.java
- AbstractBaseType.java
- BindingGeneratorUtil.java
- ReferencedTypeImpl.java
- TypeConstants.java
- Types.java
- EnumerationBuilderImpl.java
- BuilderGenerator.java
- BuilderTemplate.xtend
- ClassTemplate.xtend
- Constants.java
- EnumGenerator.java
- EnumTemplate.xtend
- GeneratorJavaFile.java
- GeneratorUtil.java
- InterfaceGenerator.java
- InterfaceTemplate.xtend
- TOGenerator.java
- CodeGenerator.java
- Enumeration.java
- WildcardType.java

-> new class NodeWrappedType was created instead of GroupingDefinitionNode a
UnionNode
-> the method resolveListTypeBuilder of BindingGeneratorImpl was removed and
its using was replaced with method addDefaultInterfaceDefinition

Change-Id: Iea6317aea75bc37883cf0f2fbf094cb8d4f02f00
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoAdded builder generation for augmentations
Tony Tkacik [Tue, 20 Aug 2013 16:58:31 +0000 (18:58 +0200)]
Added builder generation for augmentations

Added support for named augmentations

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoUpdated parser to check if unknown node is defined as language extension.
Martin Vitez [Tue, 20 Aug 2013 12:45:49 +0000 (14:45 +0200)]
Updated parser to check if unknown node is defined as language extension.

Fixed NPE in GroupingDefinitionDependencySort.

Change-Id: Ic7f89fa203c9d408f270baf9d518dc2961fac22e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fixed bug with field starting with number"
Martin Vitez [Tue, 20 Aug 2013 10:00:32 +0000 (10:00 +0000)]
Merge "Fixed bug with field starting with number"

10 years agoFixed bug with field starting with number
Tony Tkacik [Tue, 20 Aug 2013 09:56:30 +0000 (11:56 +0200)]
Fixed bug with field starting with number

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Added iana-if-type and iana-afn-safi models."
Martin Vitez [Tue, 20 Aug 2013 09:37:07 +0000 (09:37 +0000)]
Merge "Added iana-if-type and iana-afn-safi models."

10 years agoAdded iana-if-type and iana-afn-safi models.
Tony Tkacik [Mon, 19 Aug 2013 19:43:52 +0000 (21:43 +0200)]
Added iana-if-type and iana-afn-safi models.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed bug with mapping YANG identifiers starting with number to Java.
Tony Tkacik [Mon, 19 Aug 2013 19:38:08 +0000 (21:38 +0200)]
Fixed bug with mapping YANG identifiers starting with number to Java.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded support for named augmentations
Tony Tkacik [Mon, 19 Aug 2013 16:59:58 +0000 (18:59 +0200)]
Added support for named augmentations

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded instance identifier support.
Tony Tkacik [Mon, 19 Aug 2013 10:50:11 +0000 (12:50 +0200)]
Added instance identifier support.

- Added Identifiable and Identifier concepts to YANG binding
- Updated binding generator to use Identifiable and Identifier for list statements.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoChanged interface sal.binding.model.api.CodeGenerator
msunal [Wed, 7 Aug 2013 15:00:08 +0000 (17:00 +0200)]
Changed interface sal.binding.model.api.CodeGenerator

- changed return type of method signature to "String generate(Type type)"
- added method "String getUnitName(Type type)" which return name of generated unit
- refactored GeneratorJavaFile with focusing on code generators

Signed-off-by: Martin Sunal <msunal@cisco.com>
10 years agoMerge "Comment to binding-generator source code (partially) + bug fixing"
Martin Vitez [Wed, 14 Aug 2013 09:37:51 +0000 (09:37 +0000)]
Merge "Comment to binding-generator source code (partially) + bug fixing"

10 years agoComment to binding-generator source code (partially) + bug fixing
Jozef Gloncak [Tue, 13 Aug 2013 07:46:38 +0000 (09:46 +0200)]
Comment to binding-generator source code (partially) + bug fixing

Bug fix:
- in method allNotificationsToGenType was changed implemented type
from javax.management.Notification
to org.opendaylight.yangtools.yang.binding.Notification
- if typedef contain as type other typedef from other module it wasn't
  generated with input parameter in constructor (now fixed)

Change-Id: I8182abc649eef43035acdf5d934917756ab2562d
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoChanged yang-binding and yang-common to OSGi bundles
Tony Tkacik [Tue, 13 Aug 2013 15:12:29 +0000 (17:12 +0200)]
Changed yang-binding and yang-common to OSGi bundles

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Change-Id: I1c819ae1b9eee06790146a422144f79689da22c8

10 years agoFixed bug in equals method generation.
Martin Vitez [Tue, 13 Aug 2013 12:57:02 +0000 (14:57 +0200)]
Fixed bug in equals method generation.

Refactored CopyUtils class, expanded UsesAugmentTest.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRefactored parsing of uses and augment statements.
Martin Vitez [Mon, 12 Aug 2013 16:43:31 +0000 (18:43 +0200)]
Refactored parsing of uses and augment statements.

Updated tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded model generation from ietf-topology models
Tony Tkacik [Thu, 8 Aug 2013 13:56:22 +0000 (15:56 +0200)]
Added model generation from ietf-topology models

  - Moved precompilation of reusable models to
    org.opendaylight.yangtools.yang group

  - Added topology models from
       draft-clemm-netmod-yang-network-topo-00

  - Fixed bug in grouping resolving
  - Disabled generation of uncessary files for some models

Change-Id: I5eafae1fda0e854e60851725921bc8844c2f14e0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoIncreased version of yang and code-generator to 0.5.7-SNAPSHOT.
Martin Vitez [Wed, 7 Aug 2013 11:33:59 +0000 (13:33 +0200)]
Increased version of yang and code-generator to 0.5.7-SNAPSHOT.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated binding-generator-impl to support more extensible logic.
Tony Tkacik [Tue, 6 Aug 2013 14:34:55 +0000 (16:34 +0200)]
Updated binding-generator-impl to support more extensible logic.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoJava builder pattern is not generated for rcp and grouping elements
msunal [Tue, 6 Aug 2013 14:15:10 +0000 (16:15 +0200)]
Java builder pattern is not generated for rcp and grouping elements

- added method for checking whether generated type implements Augmentable interface.
If generated type is from rcp or grouping element then the generated type does not implement
Augmentable and java builder pattern is not generated.
- added test way that a generated type implements Augmentable into GeneratorJavaFileTest
- bugfix:
bug - javax.management.Notification import was used in generated interfaces extending Notification.
consequences - Therefore generated interfaces contained errors. javax.management.
fix - Notification was replaced by org.opendaylight.yangtools.yang.binding.Notification

Signed-off-by: Martin Sunal <msunal@cisco.com>
10 years agoRenamed base package names from org.opendaylight.controller to org.opendaylight.yangt...
Martin Vitez [Tue, 6 Aug 2013 11:58:29 +0000 (13:58 +0200)]
Renamed base package names from org.opendaylight.controller to org.opendaylight.yangtools.
Updated imports.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated yangtools version to 0.5.6-SNAPSHOT.
Martin Vitez [Tue, 6 Aug 2013 07:20:14 +0000 (09:20 +0200)]
Updated yangtools version to 0.5.6-SNAPSHOT.

Moved all yang-* modules under yang directory. Updated poms.
Fixed bug in yang uses processing.

Change-Id: I4b65a92d4e827bf05aa95ef234394c0eed49c0a9
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded 'code-generator' and 'model' projects from controller project.
Martin Vitez [Mon, 5 Aug 2013 18:23:25 +0000 (20:23 +0200)]
Added 'code-generator' and 'model' projects from controller project.

Signed-off-by: Martin Vitez <mvitez@cisco.com>