yangtools.git
9 years agoMerge "Bug 2843 - Restconf JSON PUT cannot update/create network-topology configurati...
Tony Tkacik [Mon, 23 Mar 2015 11:09:17 +0000 (11:09 +0000)]
Merge "Bug 2843 - Restconf JSON PUT cannot update/create network-topology configuration data"

9 years agoBug 2843 - Restconf JSON PUT cannot update/create network-topology 78/16978/2
Jan Hajnar [Mon, 23 Mar 2015 10:45:10 +0000 (11:45 +0100)]
Bug 2843 - Restconf JSON PUT cannot update/create network-topology
configuration data

* changed findSchemaNodeByNameAndNamespace() function to check for
most recent revision from potential DataSchemaNodes

Change-Id: Ie706d24e1ec064360c57d3ad073e07d4bc212dba
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "BUG-2352: Remove commons-io from features"
Tony Tkacik [Mon, 23 Mar 2015 10:08:25 +0000 (10:08 +0000)]
Merge "BUG-2352: Remove commons-io from features"

9 years agoMerge "SchemaAwareApplyOperation: use an immediate return"
Tony Tkacik [Mon, 23 Mar 2015 10:03:40 +0000 (10:03 +0000)]
Merge "SchemaAwareApplyOperation: use an immediate return"

9 years agoMerge "Do not use Iterables when we have a collection"
Tony Tkacik [Mon, 23 Mar 2015 10:01:33 +0000 (10:01 +0000)]
Merge "Do not use Iterables when we have a collection"

9 years agoMerge "BUG-2856: optimize key/leaf reference checking"
Tony Tkacik [Mon, 23 Mar 2015 10:00:06 +0000 (10:00 +0000)]
Merge "BUG-2856: optimize key/leaf reference checking"

9 years agoMerge "BUG-2856: add leaf node simplied by key"
Tony Tkacik [Mon, 23 Mar 2015 09:59:52 +0000 (09:59 +0000)]
Merge "BUG-2856: add leaf node simplied by key"

9 years agoMerge "Make sure YangInstanceIdentifier.EMPTY is retained"
Tony Tkacik [Mon, 23 Mar 2015 09:59:18 +0000 (09:59 +0000)]
Merge "Make sure YangInstanceIdentifier.EMPTY is retained"

9 years agoSchemaAwareApplyOperation: use an immediate return 56/16956/2
Robert Varga [Sun, 22 Mar 2015 14:42:07 +0000 (15:42 +0100)]
SchemaAwareApplyOperation: use an immediate return

Instead of tracking and rechecking the result of search, use an
immediate return statement when a match is found. Clarifies the code
flow.

Change-Id: I08ca3b368d007ab8a880292f75dbdc87b24a7f98
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not use Iterables when we have a collection 64/16964/2
Robert Varga [Sun, 22 Mar 2015 21:16:36 +0000 (22:16 +0100)]
Do not use Iterables when we have a collection

Ever since Ifa6260ebe157c9afde49bbb58043d6ec2fecd189 normalized node
containers and lists expose children as a collection, not iterable. That
means we have direct access to Collection#size(), so let's use that
instead of redirecting through Iterables.

Change-Id: I01c245b6b9daa9512e246213dd346f66c77a5a94
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2297: Standalone model validation tool 79/12479/14
Ladislav Borak [Tue, 4 Nov 2014 07:16:32 +0000 (08:16 +0100)]
Bug 2297: Standalone model validation tool

Initial cut at providing a standalone tool, which is able to run YANG
tools core implementation against a set of models.

Usage:
    java -jar yang-validation-tool-0.7.0-SNAPSHOT-executable.jar \
        --yang-source-dir <DIRECTORY WITH YANG FILES>

Change-Id: I22da7a2c51578eab1e91d0c7cca17a68ea879e7d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Added META-INF to gitignore to get clean git status"
Robert Varga [Sun, 22 Mar 2015 10:26:25 +0000 (10:26 +0000)]
Merge "Added META-INF to gitignore to get clean git status"

9 years agoBUG-2856: optimize key/leaf reference checking 48/16948/1
Robert Varga [Sun, 22 Mar 2015 10:20:35 +0000 (11:20 +0100)]
BUG-2856: optimize key/leaf reference checking

Since we are already iterating through the key map, we can provide the
corresponding expected value, without forcing another lookup. Introduce
a new method to take advantage of that.

Change-Id: Ia2a40f0ea2f647566059e2d68ec776bc6abc776d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2856: add leaf node simplied by key 47/16947/1
Robert Varga [Sun, 22 Mar 2015 10:13:06 +0000 (11:13 +0100)]
BUG-2856: add leaf node simplied by key

Since we have the cross-reference between key and object leaf nodes, we
enforce the consistency. Unfortunately this is not something obvious to
users. We have enough information to correct the situation, so lower the
check to apply only when an explicit inconsistency is detected.

Change-Id: I9297a7d60e4e8d4cd0680a74c1e45f412f8b5f77
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoextended test coverage of InstanceIdentifier 83/12783/4
Kinsey Nietzsche [Wed, 12 Nov 2014 13:47:30 +0000 (14:47 +0100)]
extended test coverage of InstanceIdentifier

Change-Id: Id18ae2ec969612e6c52a19449453f47e4e7e5fff
Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
9 years agoextended test coverage of YangModelDependencyInfo.java 63/12763/4
Kinsey Nietzsche [Tue, 11 Nov 2014 15:47:30 +0000 (16:47 +0100)]
extended test coverage of YangModelDependencyInfo.java

Change-Id: I68aec083f29808fda2a06bf40bee0ca930218a73
Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
9 years agoExtended coverage of YangInstanceIdentifier 77/12677/5
Kinsey Nietzsche [Mon, 10 Nov 2014 14:40:11 +0000 (15:40 +0100)]
Extended coverage of YangInstanceIdentifier

removed failing assertion from InstanceIdentifierTest

Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
Change-Id: I282c4c7730032c076c017f2c3288807c80628ad0

9 years agoMerge "Introduced skeletons of Contributor and User guide."
Robert Varga [Sun, 22 Mar 2015 09:33:28 +0000 (09:33 +0000)]
Merge "Introduced skeletons of Contributor and User guide."

9 years agoAdded META-INF to gitignore to get clean git status 33/13433/2
Charalampos Kaidos [Sat, 6 Dec 2014 13:43:14 +0000 (15:43 +0200)]
Added META-INF to gitignore to get clean git status

Change-Id: I77d979e3c1e014614a9bdd84d1189880c88b9a94
Signed-off-by: Charalampos Kaidos <ckaidos@intracom-telecom.com>
9 years agoBug 2366: Initial implementation of Statement Reactor 51/15351/9
Martin Ciglan [Fri, 20 Mar 2015 12:36:18 +0000 (13:36 +0100)]
Bug 2366: Initial implementation of Statement Reactor

Initial implementation of statement reactor,
which supports:
   - loading linkage statements from models
   - modifiers
   - resolving of forward references
   - building final statments

Implementation currently does not support:

- export of PrefixToQNameModule and QNameToStatementDefinition
  namespaces during loading statement streams.
- copying statement subtrees (useful for uses, augmentations)

Added initial set of tests - which deals with
RFC6020 import resolution.

Change-Id: Idde3ce496228a157ba11c07bccf6f177c52a8fe9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoMerge "Bug 2361: Added prototype implementation using new SPI."
Robert Varga [Sat, 21 Mar 2015 17:22:49 +0000 (17:22 +0000)]
Merge "Bug 2361: Added prototype implementation using new SPI."

9 years agoBug 2361: Added prototype implementation using new SPI. 67/15167/11
Martin Ciglan [Fri, 20 Mar 2015 12:08:03 +0000 (13:08 +0100)]
Bug 2361: Added prototype implementation using new SPI.

This prototype level implementation of module, namespace,
import, uses and container statement shows usage
of meta-level SPI in order to introduce support for
concrete statements.

Note that this is same SPI, which is to be used
to introduce new statement or extension support
directly to the YANG parser.

Change-Id: I5124a06669d48d3a32d585c4c75de5b2228f2eac
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 2874: Fixed JSON parsing of choice inside augment 13/16913/1
Tony Tkacik [Fri, 20 Mar 2015 10:53:11 +0000 (11:53 +0100)]
Bug 2874: Fixed JSON parsing of choice inside augment

Code of JSON parser was aware of choice being part of
augmentation, but small typo resulted in not putting
choice inside this augmentation.

Change-Id: I2b90517571e28843e6cc824306be8a864a7c5387
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2352: Remove commons-io from features 76/16476/6
Robert Varga [Fri, 13 Mar 2015 11:08:21 +0000 (12:08 +0100)]
BUG-2352: Remove commons-io from features

Yangtools OSGi artifacts no longer require commons-io at runtime, so
remove it from the feature.

Change-Id: I22fb194cd670f3dbe9af4eb4cdc079bdd2bba29d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 868: Removed Composite Nodes from Yangtools"
Robert Varga [Fri, 20 Mar 2015 07:17:39 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Composite Nodes from Yangtools"

9 years agoMerge "Bug 868: Removed Binding to Composite Node codecs."
Robert Varga [Fri, 20 Mar 2015 07:17:23 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Binding to Composite Node codecs."

9 years agoBug 868: Removed Composite Nodes from Yangtools 38/16838/1
Tony Tkacik [Thu, 19 Mar 2015 15:25:29 +0000 (16:25 +0100)]
Bug 868: Removed Composite Nodes from Yangtools

Change-Id: I69d274d08dbe73900377a6715ac6c6f784e831c1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 868: Removed Binding to Composite Node codecs. 36/16836/1
Tony Tkacik [Thu, 19 Mar 2015 14:29:06 +0000 (15:29 +0100)]
Bug 868: Removed Binding to Composite Node codecs.

Change-Id: Ia54519c88870fada74bd2d7ce579c0e77d687157
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2383: deprecate ModificationType.MERGE 21/16821/3
Robert Varga [Thu, 19 Mar 2015 11:23:57 +0000 (12:23 +0100)]
BUG-2383: deprecate ModificationType.MERGE

The entire ModificationType enum is an accidental leak from the
implementation. The most pressing deficiency is that we do not want to
leak the merge operation, but report it either as a subtree modification
or a write.

Introduce a new type, LogicalOperation, which contains all the current
and use it internally. The new name also implies slight changes in how
the states are called:

ModificationType.UNMODIFIED maps to LogicalOperation.NONE
ModificationType.SUBTREE_MODIFIED maps to LogicalOperation.TOUCH

Change-Id: I446e4391583de060b2ab722deb5c004f60c8e6e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Reduce InMemoryDataTree logging"
Robert Varga [Thu, 19 Mar 2015 14:34:12 +0000 (14:34 +0000)]
Merge "Reduce InMemoryDataTree logging"

9 years agoBug 868: Made sure Restconf client POC does not use CompositeNodes. 22/16822/4
Tony Tkacik [Thu, 19 Mar 2015 12:21:53 +0000 (13:21 +0100)]
Bug 868: Made sure Restconf client POC does not use CompositeNodes.

Change-Id: I64a940fa86cb0a0f4adccfde401b7073f7bbf9b8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoReduce InMemoryDataTree logging 85/15585/2
tpantelis [Fri, 20 Feb 2015 00:34:44 +0000 (19:34 -0500)]
Reduce InMemoryDataTree logging

In setSchemaContext it logs the "Attempting to install schema contexts"
message to info which causes significant clutter in the karaf log - as
many as thousands of messages on startup and shutdown. I don't think
this message provides any useful information anyway so I removed it as
a similar message is logged to debug with context.

Change-Id: I0df9c3f49bd8173318b7b68584d066739ae7a562
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoMake sure YangInstanceIdentifier.EMPTY is retained 16/16816/1
Robert Varga [Thu, 19 Mar 2015 10:35:47 +0000 (11:35 +0100)]
Make sure YangInstanceIdentifier.EMPTY is retained

Passing an empty YangInstanceIdentifier through serialize/deserialize
would result in an additional instance. This can reduce efficiency, as
comparison does no longer use same-instance check.

Add a readResolve() method, which will enforce the singleton instance
for empty YangInstanceIdentifier.

Change-Id: Ia5fc28e182f78ce7816c5977a3c3305d8f1b71f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG 2868: Update iana-if-type with RFC 7224 68/16768/1
Vishal Thapar [Wed, 18 Mar 2015 13:49:13 +0000 (19:19 +0530)]
BUG 2868: Update iana-if-type with RFC 7224

Change-Id: Ide79db6c34fb23bd2c773a614c35d1e436b7d237
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
9 years agoMerge "Bug 2864: Fixed (de)serialization of leafrefs"
Robert Varga [Wed, 18 Mar 2015 11:10:43 +0000 (11:10 +0000)]
Merge "Bug 2864: Fixed (de)serialization of leafrefs"

9 years agoBug 2864: Fixed (de)serialization of leafrefs 52/16752/1
Tony Tkacik [Wed, 18 Mar 2015 10:18:01 +0000 (11:18 +0100)]
Bug 2864: Fixed (de)serialization of leafrefs

Leafrefs in JSON were not properly deserialized
for non-simple types as Instance Identifier
or Identityref, which requires schema-sensitive
parsing.

Reworked JSONCodecFactory to create and store codecs
by DataSchemaNode, since leafref resolution
requires location in data schema tree, which
was not required for other codecs.

Actual codec is selected by looking up schema of
type referenced by leafref and codec is constructed
from that type.

Change-Id: Ia650b99933b177d31bee3f4b38f42e22227120d6
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."
Robert Varga [Wed, 18 Mar 2015 09:34:56 +0000 (09:34 +0000)]
Merge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."

9 years agoMerge "Bug 2804: Fixed incorrect emiting of some arguments."
Robert Varga [Wed, 18 Mar 2015 09:33:21 +0000 (09:33 +0000)]
Merge "Bug 2804: Fixed incorrect emiting of some arguments."

9 years agoBug 2857: Tied pre-existing implementation to BindingCodecTree. 01/16701/4
Tony Tkacik [Thu, 12 Mar 2015 11:06:00 +0000 (12:06 +0100)]
Bug 2857: Tied pre-existing implementation to BindingCodecTree.

BindingCodecTree provides public view into backing structure
of binding-data-codec, which was designed and already implemented
as data tree.

By exposing these power-users could build their own
Binding to DOM adapters, where they could customize some aspects
of serialization or precache over-used codecs in order
to speed up performance.

Change-Id: I827eb6014b28d0b6d4256b677ee56d3081ff80b0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2804: Fixed incorrect emiting of some arguments. 02/16702/2
Tony Tkacik [Tue, 17 Mar 2015 14:30:32 +0000 (15:30 +0100)]
Bug 2804: Fixed incorrect emiting of some arguments.

For some YANG or extension statements, arguments
were not emmited as separate YIN element, but as
argument.

Added explicit check which extracts YIN element
information from RFC6020 mapping and ExtensionDefinition.

Change-Id: I8ebfdd21c2890e7eaeaf207ca43a7c4896369130
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2859: Key generation when anonymous Enum was used. 39/16639/3
Tony Tkacik [Mon, 16 Mar 2015 13:31:50 +0000 (14:31 +0100)]
Bug 2859: Key generation when anonymous Enum was used.

Binding list key was generated with incorrect type,
when anonymous enumeration was defined in leaf in grouping
and that leaf was used for list.

Change-Id: Idcb114be49280f77af8054d8d83c5d8e6f453665
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2846 - Ordered-by user is broken again - SFC is broken"
Tony Tkacik [Mon, 16 Mar 2015 10:03:50 +0000 (10:03 +0000)]
Merge "Bug 2846 - Ordered-by user is broken again - SFC is broken"

9 years agoBug 2846 - Ordered-by user is broken again - SFC is broken 22/16622/2
Jan Hajnar [Mon, 16 Mar 2015 08:59:42 +0000 (09:59 +0100)]
Bug 2846 - Ordered-by user is broken again - SFC is broken

* fixed gson codec to create ordered map node when "ordered-by user" is
defined in schema

Change-Id: I81e01aa051405630b58b180b4d730aba64c04b93
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Lower commons-lang3 dependency"
Tony Tkacik [Mon, 16 Mar 2015 09:09:33 +0000 (09:09 +0000)]
Merge "Lower commons-lang3 dependency"

9 years agoMerge "BUG-2512: get rid of commons-io"
Tony Tkacik [Mon, 16 Mar 2015 07:28:48 +0000 (07:28 +0000)]
Merge "BUG-2512: get rid of commons-io"

9 years agoMerge "BUG-2352: Remove RestMessageTools"
Tony Tkacik [Mon, 16 Mar 2015 07:28:38 +0000 (07:28 +0000)]
Merge "BUG-2352: Remove RestMessageTools"

9 years agoMerge "Migrate from BindingGeneratorUtil"
Tony Tkacik [Mon, 16 Mar 2015 07:28:07 +0000 (07:28 +0000)]
Merge "Migrate from BindingGeneratorUtil"

9 years agoMerge "BUG-2829: make static QName field hold a cached reference"
Tony Tkacik [Mon, 16 Mar 2015 07:13:14 +0000 (07:13 +0000)]
Merge "BUG-2829: make static QName field hold a cached reference"

9 years agoLower commons-lang3 dependency 74/16474/2
Robert Varga [Fri, 13 Mar 2015 10:50:56 +0000 (11:50 +0100)]
Lower commons-lang3 dependency

This library is only used in tests, so lower the dependency.

Change-Id: Id530866be998969e0c8cf786e2005b38987163b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2512: get rid of commons-io 73/16473/2
Robert Varga [Fri, 13 Mar 2015 10:44:35 +0000 (11:44 +0100)]
BUG-2512: get rid of commons-io

Guava/JDK give us everything we need, no need to have yet another
library in the dependencies.

Change-Id: I3f5e21a3b41bee099a13cb21e972ee4ddb77b77e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2352: Remove RestMessageTools 75/16475/2
Robert Varga [Fri, 13 Mar 2015 11:03:35 +0000 (12:03 +0100)]
BUG-2352: Remove RestMessageTools

This is a prototype implementation, whose sole method never worked.

Change-Id: Id7fa10ac7e541bac80173c40af3fd2b00e1586ab
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd ietf-interfaces to model. 48/16248/5
Deepthi V V [Tue, 10 Mar 2015 10:46:23 +0000 (16:16 +0530)]
Add ietf-interfaces to model.

ietf-interfaces is a standard ietf yang model. This will be used by
vpnservice project.

Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
Change-Id: I787e945a39417cc85c79b11cb28264b82cd168e6
Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
9 years agoMigrate from BindingGeneratorUtil 20/16420/4
Robert Varga [Thu, 12 Mar 2015 22:50:52 +0000 (23:50 +0100)]
Migrate from BindingGeneratorUtil

BindingMapping is the new home for mapping module namespaces to java
package names.

Change-Id: I61ecf91c2ffa78a6e62c00feaf5fd7879dd89cf9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2287 - TypeProviderImpl retains empty HashMaps 77/13477/7
Ladislav Borak [Tue, 9 Dec 2014 11:32:24 +0000 (12:32 +0100)]
Bug 2287 - TypeProviderImpl retains empty HashMaps

Allocating default HashMaps is wasteful, especially if we end up not
storing anything in them. This fixes that case by making sure we
allocate a map only after we are sure we are going to put something into
it. Also be conservative about the size, so we do not waste too much
space.

Change-Id: I85ad1506e732a5c3728ef3529e7e0b5b430d758a
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2818: Updated implementation of parser."
Robert Varga [Thu, 12 Mar 2015 21:20:01 +0000 (21:20 +0000)]
Merge "Bug 2818: Updated implementation of parser."

9 years agoBug 2818: Updated implementation of parser. 12/16412/1
Tony Tkacik [Thu, 12 Mar 2015 20:00:08 +0000 (21:00 +0100)]
Bug 2818: Updated implementation of parser.

Moved special-case handling from nested classes up
to main parse cycle, which simplifies code. Also
added additional test, which tests behaviour
according the draft-lhotka.

Change-Id: I79bfa62221a6bbe914158b0fae3f51f4571ff9dd
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2829: make static QName field hold a cached reference 10/16410/1
Robert Varga [Thu, 12 Mar 2015 19:49:11 +0000 (20:49 +0100)]
BUG-2829: make static QName field hold a cached reference

A QName (and QNameModule) exposes an API to obtain a system-wide
shared reference to an object. Use this facility to share QNameModules
across all generated classes, as well as sharing potentially duplicate
QNames.

Change-Id: Icfd0c48edbd37e54be1a436480d5808d4efaf29d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Eliminate all trailing whitespace in xtend"
Tony Tkacik [Thu, 12 Mar 2015 17:10:46 +0000 (17:10 +0000)]
Merge "Eliminate all trailing whitespace in xtend"

9 years agoMerge "Make sure we do not generate trailing whitespace"
Tony Tkacik [Thu, 12 Mar 2015 17:10:41 +0000 (17:10 +0000)]
Merge "Make sure we do not generate trailing whitespace"

9 years agoMerge "Bug 2818: Introduced optional array for parsing root list items."
Robert Varga [Thu, 12 Mar 2015 17:10:21 +0000 (17:10 +0000)]
Merge "Bug 2818: Introduced optional array for parsing root list items."

9 years agoEliminate all trailing whitespace in xtend 03/16403/2
Robert Varga [Thu, 12 Mar 2015 16:44:31 +0000 (17:44 +0100)]
Eliminate all trailing whitespace in xtend

The API generator output should not contain trailing whitespace --
cleanup the templates to make sure we do not pollute output.

Change-Id: Ia312d1e2a0218a51eac42a62446bb6af63d69ee6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMake sure we do not generate trailing whitespace 02/16402/2
Robert Varga [Thu, 12 Mar 2015 16:42:08 +0000 (17:42 +0100)]
Make sure we do not generate trailing whitespace

If we get an empy line in description, it is possible for us to generate
trailing whitespace. Make sure we don't do that and also clean any
trailing whitespace from the source file itself.

Change-Id: I8ea20c92cce5a6dccc1c107af97b959af4264f84
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2818: Introduced optional array for parsing root list items. 05/16405/1
Tony Tkacik [Thu, 12 Mar 2015 16:44:21 +0000 (17:44 +0100)]
Bug 2818: Introduced optional array for parsing root list items.

Specification draft-lhotka-netmod-yang-json-02 clearly
specifies that list must be serialized as array of objects,
but currently only user of yang-json is
draft-bierman-netconf-restconf-02, which specifies
and provides example where such list exists are also used
without arrays when parsing.

Introduced support for this case (and unit test),
in order to interoperate with clients, which follows
serialization as was provided in examples of restconf.

Change-Id: I4ebf7cfba17752de2184e9b7ac1d18c1ecac6f80
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2248 - mvn clean install is failing due to checkstyle"
Robert Varga [Thu, 12 Mar 2015 14:50:26 +0000 (14:50 +0000)]
Merge "Bug 2248 - mvn clean install is failing due to checkstyle"

9 years agoMerge "Fixed generation of UnionBuilders for anonymous unions."
Robert Varga [Thu, 12 Mar 2015 14:47:15 +0000 (14:47 +0000)]
Merge "Fixed generation of UnionBuilders for anonymous unions."

9 years agoIntroduction of more powerful binding codec APIs 64/15964/6
Tony Tkacik [Tue, 3 Mar 2015 11:06:31 +0000 (12:06 +0100)]
Introduction of more powerful binding codec APIs

Introduces new more expresive APIs, which allows
user to customize serialization / deserialization.

Introduced new concepts:

 - Subtree codecs
    - Tree and cursor based APIs for locating subtree
 - Caching Codec - codec which uses cache for serialization

Change-Id: If4868c9cd20c56d2ce0498bd2ded90b1265f7b67
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoFixed generation of UnionBuilders for anonymous unions. 90/16390/2
Tony Tkacik [Thu, 12 Mar 2015 13:27:22 +0000 (14:27 +0100)]
Fixed generation of UnionBuilders for anonymous unions.

Change-Id: I18e90e7d7227efe31767734df1ce525df60104d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2248 - mvn clean install is failing due to checkstyle 53/12953/13
Ladislav Borak [Thu, 11 Dec 2014 12:07:59 +0000 (13:07 +0100)]
Bug 2248 - mvn clean install is failing due to checkstyle

- added check in BaseTemplate.imports() if imported type has same package
  as generated type

Change-Id: Ifefb4be88c145aa222541cbb901aa9cab63b510d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-1513: make sure client code remains compatible 38/16338/1
Robert Varga [Wed, 11 Mar 2015 16:39:18 +0000 (17:39 +0100)]
BUG-1513: make sure client code remains compatible

This updates the single implementation of ChoiceNode so that it
implements the legacy interface, too -- thus instanceof checks will
continue to work.

Change-Id: Iea9938ac434d5a07891ab24cef0193b7261783ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1513: finish migration of ChoiceNodes 06/16306/1
Robert Varga [Wed, 11 Mar 2015 09:21:42 +0000 (10:21 +0100)]
BUG-1513: finish migration of ChoiceNodes

This migrates the leftover users to make them work correctly.

Change-Id: I134c82d29a6b192455f670d2f1a9477a688fff25
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1513: introduce ChoiceSchemaNode 70/16270/7
Robert Varga [Tue, 10 Mar 2015 12:03:32 +0000 (13:03 +0100)]
BUG-1513: introduce ChoiceSchemaNode

This introduces the alternative name, which does not clash with
yang-data-api. Also deprecated ChoiceNode.

Change-Id: I42e93c45804dc8e3952d08c697f772d776c303c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Migrate to BasicGenerator"
Tony Tkacik [Tue, 10 Mar 2015 19:50:08 +0000 (19:50 +0000)]
Merge "Migrate to BasicGenerator"

9 years agoMerge "BUG 2282 - JSON top level element without module name"
Tony Tkacik [Tue, 10 Mar 2015 19:30:59 +0000 (19:30 +0000)]
Merge "BUG 2282 - JSON top level element without module name"

9 years agoBUG 2282 - JSON top level element without module name 68/12668/9
Jozef Gloncak [Mon, 3 Nov 2014 15:02:54 +0000 (16:02 +0100)]
BUG 2282 - JSON top level element without module name

Json top level element now doesn't have to contain module name prefix.

If namespace of some child element was changed and only one child with
specified name exist in schema then its namespace is used by default.

If more then one potential child in various namespaces exists then
exception is raised. Exception is also raised if no such element as
specified in JSON input exists in YANG schema.

Change-Id: I8a38fde4f2e9b79562f6bf7c79acafd51c7bff32
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
(cherry picked from commit 6eee2a1ce9e69a7b653a7b4427573eff67588d1f)

9 years agoMigrate to BasicGenerator 80/16280/2
Robert Varga [Tue, 10 Mar 2015 16:33:49 +0000 (17:33 +0100)]
Migrate to BasicGenerator

This is just a documentation reference, so update it to the new
interface.

Change-Id: Ia21b0ea89f4fc478695555f65983b964ed908ba7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Remove unneeded annontation"
Tony Tkacik [Tue, 10 Mar 2015 15:27:32 +0000 (15:27 +0000)]
Merge "Remove unneeded annontation"

9 years agoMerge "Fix a generic warning"
Tony Tkacik [Tue, 10 Mar 2015 15:27:24 +0000 (15:27 +0000)]
Merge "Fix a generic warning"

9 years agoMerge "Execute yang-maven-plugin"
Tony Tkacik [Tue, 10 Mar 2015 15:27:17 +0000 (15:27 +0000)]
Merge "Execute yang-maven-plugin"

9 years agoRemove unneeded annontation 69/16269/1
Robert Varga [Tue, 10 Mar 2015 14:49:27 +0000 (15:49 +0100)]
Remove unneeded annontation

Change-Id: I7886d28fcaee4e7e8563dc8f9f15a92bd7054b06
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix a generic warning 68/16268/1
Robert Varga [Tue, 10 Mar 2015 14:47:32 +0000 (15:47 +0100)]
Fix a generic warning

Add generic arguments to fix a warning.

Change-Id: I249258370efe32d26189cf236818c483b8f0d915
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd support for attributes int NN stream writer(list entry) 58/16258/1
Maros Marsalek [Tue, 10 Mar 2015 10:50:10 +0000 (11:50 +0100)]
Add support for attributes int NN stream writer(list entry)

Change-Id: I2191ea7809c5b914b982f8514eda5952b3659e7d
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoExecute yang-maven-plugin 67/16267/1
Robert Varga [Tue, 10 Mar 2015 12:06:03 +0000 (13:06 +0100)]
Execute yang-maven-plugin

This eases integration with eclipse, as we should be interacting with it
well now.

Change-Id: I31832abf40e6965b846beaa762a91c2a888c5b57
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAnyXml NormalizedNode wraps a DOMSource value 51/16251/2
Maros Marsalek [Thu, 5 Mar 2015 14:07:27 +0000 (15:07 +0100)]
AnyXml NormalizedNode wraps a DOMSource value

Instead of wrapping a CompositeNode, a DOM source is used as inner value for
AnyXml. XML -> NormalizedNode parser was updated as well as NormalizedNode ->
XML stream writer.

Change-Id: Ide51b2a08969a65d492c18f4b594e7559fee5844
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoAdd support for attributes int NN stream writer 50/16250/2
Maros Marsalek [Tue, 10 Mar 2015 10:50:10 +0000 (11:50 +0100)]
Add support for attributes int NN stream writer

Change-Id: I51dc747763a65dee5145a33657eaf7223945d096
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Bug 2766: Fixed parsing and serializing XPath Instance Identifiers"
Robert Varga [Mon, 9 Mar 2015 09:18:02 +0000 (09:18 +0000)]
Merge "Bug 2766: Fixed parsing and serializing XPath Instance Identifiers"

9 years agoIntroduced MethodHandle based invokers for Notification and RPCs 93/16093/3
Tony Tkacik [Thu, 5 Mar 2015 21:04:43 +0000 (22:04 +0100)]
Introduced MethodHandle based invokers for Notification and RPCs

This invokers are used to provide genereralized access to any
generated callback / rpc method using one approach for
any RPC.

Change-Id: I4d6ce7c71f658b5e2c6e805479aa47a8f09fb989
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2766: Fixed parsing and serializing XPath Instance Identifiers 00/15900/8
Tony Tkacik [Mon, 2 Mar 2015 13:39:49 +0000 (14:39 +0100)]
Bug 2766: Fixed parsing and serializing XPath Instance Identifiers

Original implementation of Instance Identifier codec used
Splitters which did not have enough information to determine
that '/' is used in string literals.

Fortunatelly Instance Identifier is only very constrained
subset of XPath, so it was still possible to reimplement
correct token-based parser using Guava.

Other problem fixed with  parsing instance identifiers was
that YangInstanceIdentifier also contained components,
which are not present in XML / JSON serialization.

Change-Id: I4186f59f8e16c92eb2e0ca2bc0a6c12e7215a3be
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Revert "AnyXml NormalizedNode wraps a DOMResult value""
Tony Tkacik [Sun, 8 Mar 2015 11:53:14 +0000 (11:53 +0000)]
Merge "Revert "AnyXml NormalizedNode wraps a DOMResult value""

9 years agoRevert "AnyXml NormalizedNode wraps a DOMResult value" 69/16169/1
Tony Tkacik [Sun, 8 Mar 2015 11:39:33 +0000 (11:39 +0000)]
Revert "AnyXml NormalizedNode wraps a DOMResult value"

This reverts commit c5bde84eced27e2d073554420c3f47eca85af32c.

Commit was merged before clients were able to migrate.

Change-Id: I7ab48a36f5dbbd52e8b91be8ea049b72a776ea15
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Make sure maven artifacts are provided"
Tony Tkacik [Sun, 8 Mar 2015 10:37:21 +0000 (10:37 +0000)]
Merge "Make sure maven artifacts are provided"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:37:07 +0000 (10:37 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:48 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:37 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Do not rely on transitive dependencies"
Tony Tkacik [Sun, 8 Mar 2015 10:36:28 +0000 (10:36 +0000)]
Merge "Do not rely on transitive dependencies"

9 years agoAnyXml NormalizedNode wraps a DOMResult value 84/16084/4
Maros Marsalek [Thu, 5 Mar 2015 14:07:27 +0000 (15:07 +0100)]
AnyXml NormalizedNode wraps a DOMResult value

Instead of wrapping a CompositeNode, a DOM result is used as inner value for
AnyXml. XML -> NormalizedNode parser was updated as well as NormalizedNode ->
XML stream writer.

Change-Id: I8cb6875bf395385d0f10d16d5e9d7361e9172e5a
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoPreserve backwards compatibility in DomToNormalizedNodeParserFactory 29/16129/2
Maros Marsalek [Fri, 6 Mar 2015 08:21:57 +0000 (09:21 +0100)]
Preserve backwards compatibility in DomToNormalizedNodeParserFactory

Restore the former constructor with only CodecProvider but make it deprecated

Change-Id: I1cd9c9af4ac16baa228503fb125a587614a52d2e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMake sure maven artifacts are provided 79/16079/1
Robert Varga [Thu, 5 Mar 2015 13:38:46 +0000 (14:38 +0100)]
Make sure maven artifacts are provided

We expect these to be provided, not brought in explicitly.

Change-Id: I36d86f4c8beea33d6f279ba8986d1e987efe514d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 78/16078/1
Robert Varga [Thu, 5 Mar 2015 13:30:24 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings. Also remove use of
deprecated types and speed up stringuilder usage by passing characters
instead of strings where possible.

Change-Id: I3131166a2fedf09743e6baf4159ba15357a37993
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 77/16077/1
Robert Varga [Thu, 5 Mar 2015 13:30:02 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: I88f7b68cd2fdddf0bb39c2bbc8f2c8533de22006
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 76/16076/1
Robert Varga [Thu, 5 Mar 2015 13:28:51 +0000 (14:28 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: Ic28a868eeef8167a1f7e8b3946c2ea13526818dc
Signed-off-by: Robert Varga <rovarga@cisco.com>