yangtools.git
4 years agoDisable SpotBugs enforcement on select artifacts 86/83886/3
Robert Varga [Thu, 22 Aug 2019 10:42:41 +0000 (12:42 +0200)]
Disable SpotBugs enforcement on select artifacts

odlparent has started enforcing SpotBugs by default, but some of
our artifacts are not ready for that. Disable enforcement through
the odlparent property and document why we are disabling it.

Change-Id: Ie8d3e43b26efd75e70223dde2b4555865ce25001
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle 85/83885/3
Robert Varga [Thu, 22 Aug 2019 10:41:27 +0000 (12:41 +0200)]
Fix checkstyle

This fixes issues found by checkstyle.

Change-Id: Iecab9171c2d4d63cf564139c714a4552d069636b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpand MapAdaptor javadoc 92/83792/1
Robert Varga [Tue, 20 Aug 2019 12:17:21 +0000 (14:17 +0200)]
Expand MapAdaptor javadoc

This fixes a few warnings around javadoc completes of MapAdaptor.

Change-Id: I6bb7b6354530b4ad47a07b4b0358c720b80b4230
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake sure readOnly field is initialized 87/83787/3
Robert Varga [Tue, 20 Aug 2019 11:49:28 +0000 (13:49 +0200)]
Make sure readOnly field is initialized

Make sure the readOnly field is forced to be initialed to null
by making it a volatile.

Change-Id: I366835a8009fe6fe21992b374f959bfcefcde18e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRelax read-only snapshot memory fencing 67/83767/1
Robert Varga [Mon, 19 Aug 2019 15:07:09 +0000 (17:07 +0200)]
Relax read-only snapshot memory fencing

With Java 9 we can use VarHandles to reduce memory ordering guarantees
from volatile to acquire/releases.

Use this facility to disconnect ReadOnlyTrieMap from other volatiles,
potentially helping the compiler to do a better job optimizing.

Change-Id: Ibd266a5a341bcdaae25702476610c10eeb0ea374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 6.0.0-SNAPSHOT 83/83383/17
Robert Varga [Mon, 5 Aug 2019 09:27:39 +0000 (11:27 +0200)]
Bump odlparent to 6.0.0-SNAPSHOT

We will need some JDK11 work done, for that we'll use odlparent
snapshots for a while.

Due to MJAVADOC (and underlying JDK-8220702) we keep the target of
yang-data-impl and yang-parser-rfc7950 at 8.

Change-Id: I3da91a8a6b1dfd4cc40c7e0e9fdd527733da5331
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGeneralize ForwardingIdentityObject 17/83717/3
Robert Varga [Fri, 16 Aug 2019 17:01:18 +0000 (19:01 +0200)]
Generalize ForwardingIdentityObject

Wrapping objects in identity comparison is useful, and there
seems to be no readily-avaible utility. This introduces an
extension to ForwardingObject and a simple utility class to
implement its construct.

JIRA: YANGTOOLS-1016
Change-Id: If0d7a2f731b0a294570f8ba39ce5da7236e2c752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix schema-ref traversal 85/83685/1
Anna Bencurova [Thu, 15 Aug 2019 12:17:34 +0000 (14:17 +0200)]
Fix schema-ref traversal

When traversing schema-mount definitions, we need to account for
schema-ref being a choice and hence its children are not directly
reachable.

JIRA: YANGTOOLS-1015
Change-Id: Iaa9ddbf33c172c433cb323166e5b1bcea5eea649
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd @SuppressModernizer 15/83415/9
Robert Varga [Tue, 6 Aug 2019 08:42:49 +0000 (10:42 +0200)]
Add @SuppressModernizer

We are mucking with modernizable constructs on purpose, add
suppressions to keep modernizer quiet.

Change-Id: Ia25640be14f1943a976c4edda6247124986a9d15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove PrefixToModule.isPreLinkageMap() 08/83408/9
Robert Varga [Tue, 6 Aug 2019 07:24:24 +0000 (09:24 +0200)]
Remove PrefixToModule.isPreLinkageMap()

This property is not used anywhere, remove it.

Change-Id: I4e1674f5b4a00b68e6d3b40b62ebc2a3fcc95573
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSwitch to using java.util.Base64 17/83417/5
Robert Varga [Tue, 6 Aug 2019 10:43:54 +0000 (12:43 +0200)]
Switch to using java.util.Base64

This follows modernizer recommendation of using java.util.Base64
instead of Guava's BaseEncoding.

Change-Id: I72a49503980fb615ce27d2e3d0a84cbb1b033236
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd more modernization 20/83420/1
Robert Varga [Tue, 6 Aug 2019 11:16:15 +0000 (13:16 +0200)]
Add more modernization

This nails down a missed use of Lists.newArrayList(), fix that.

Change-Id: I0587e92bed503e642b1d003cb10a6947b98ff7a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoApply modernization 14/83414/2
Robert Varga [Tue, 6 Aug 2019 08:39:43 +0000 (10:39 +0200)]
Apply modernization

This fixes up use of old constructs pointed out by maven modernizer
plugin.

Change-Id: I3f926678763f72b195ae961ce7f220a1845fef52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove Decimal64.toInt() method 97/83397/4
Robert Varga [Mon, 5 Aug 2019 16:04:11 +0000 (18:04 +0200)]
Move Decimal64.toInt() method

This utility is only used in nested class, move it to keep SpotBugs
happy under Java 11.

Change-Id: I405718bf3db9ebcdd972ae5a71c47570c424f730
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkArgument constructor 04/83404/3
Robert Varga [Tue, 6 Aug 2019 06:23:59 +0000 (08:23 +0200)]
Fix checkArgument constructor

This adds a missing argument and removes the need for synthetic
accessors.

Change-Id: I7e293036b35b86c9ac555f2880747748b8c35443
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix stmt.compat Java 11 compilation 98/83398/4
Robert Varga [Mon, 5 Aug 2019 18:34:27 +0000 (20:34 +0200)]
Fix stmt.compat Java 11 compilation

Java 11 inference does not like the implicit cast, although it is
supposed to be safe. We do not really need it, remove it.

Change-Id: Ic2b89a523eb91cb86cd669dc9670c6acba214dca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle errors 96/83396/3
Robert Varga [Mon, 5 Aug 2019 14:14:49 +0000 (16:14 +0200)]
Fix checkstyle errors

Upgraded checkstyle plugin is finding some more errors, fix them
up.

Change-Id: Id58302b1dcd0574fa94340965c15259621a9156d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.2-SNAPSHOT 13/83413/1
Robert Varga [Tue, 6 Aug 2019 08:52:51 +0000 (10:52 +0200)]
Bump odlparent to 5.0.2-SNAPSHOT

This is an intermediate bump to fix javadoc/jdk11 issues.

Change-Id: I407c6e1712b304cef4d0a46e223094f16903e04a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle errors 90/83390/1
Robert Varga [Mon, 5 Aug 2019 14:14:49 +0000 (16:14 +0200)]
Fix checkstyle errors

Upgraded checkstyle plugin is finding some more errors, fix them
up.

Change-Id: I755c73be82230cb1a1a22fd776322b7a1d2afc4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove javadoc plugin version override 82/83382/2
Robert Varga [Mon, 5 Aug 2019 09:25:58 +0000 (11:25 +0200)]
Remove javadoc plugin version override

odlparent is using a newer plugin, remove the unneeded override.

Change-Id: I6afb495233e3959364c45eb3189cabe20ebdcf5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove NodeIdentifierWithPredicates.getKeyValues() 03/82603/12
Robert Varga [Thu, 20 Jun 2019 13:52:01 +0000 (15:52 +0200)]
Remove NodeIdentifierWithPredicates.getKeyValues()

This method has been deprecated, with entrySet()/keySet() being
its replacements.

Change-Id: Ie1d2a61539fd86584aff9d6aea8d11f63f1908e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoHide effective statement implementations 06/69206/20
Robert Varga [Wed, 7 Mar 2018 12:03:02 +0000 (13:03 +0100)]
Hide effective statement implementations

Remove deprecated tags and address the 3.0.0 guidance instructions,
hiding the implementation classes.

Change-Id: I42d2e580a513e02657fd7f927b025e329e067104
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove public NodeIdentifierWithPredicates constructors 02/82602/11
Robert Varga [Thu, 20 Jun 2019 13:48:31 +0000 (15:48 +0200)]
Remove public NodeIdentifierWithPredicates constructors

This removes constructors in favor of static factory methods.

Change-Id: I0881f42ed2a0599bf48e0a84a9dcd06194f32f83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake QName subclass AbstractQName 64/81064/8
Robert Varga [Thu, 21 Mar 2019 09:09:17 +0000 (10:09 +0100)]
Make QName subclass AbstractQName

This breaks serialization format compatibility with all versions
older than 3.0.0 by changing the QName class hierarchy.

JIRA: YANGTOOLS-970
Change-Id: I7e1b655ceb06186ca82f34b6c6d3f6adb12b30f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump version to 4.0.0-SNAPSHOT 18/83318/1
Robert Varga [Tue, 30 Jul 2019 10:20:54 +0000 (12:20 +0200)]
Bump version to 4.0.0-SNAPSHOT

This starts next major version development.

Change-Id: I9c0ced5fc5341b432b3d206157f801d30d03f9b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTeach DataSchemaContextNode about anydata 03/83303/2
Robert Varga [Mon, 29 Jul 2019 15:25:54 +0000 (17:25 +0200)]
Teach DataSchemaContextNode about anydata

We failed to account for anydata nodes, which should behave the
same way as anyxml nodes.

Change-Id: Id8a2aff60921094e149f58c8b7bba1822587c96f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump version to 3.0.5-SNAPSHOT 93/83293/1
Robert Varga [Mon, 29 Jul 2019 09:10:20 +0000 (11:10 +0200)]
Bump version to 3.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: Iaf21895aadee2433c1bba42e0b3fa8097f4ae8e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Check for nested augmentations" 91/83291/1
Robert Varga [Mon, 29 Jul 2019 08:41:59 +0000 (10:41 +0200)]
Revert "Check for nested augmentations"

This reverts commit 759e69d85991edb987a760165adb83fa3f2ab67b.

JIRA: YANGTOOLS-956
Change-Id: I3c80751043a101de77292bc91e0c1c4178d16f44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCheck for nested augmentations 45/81145/6
Robert Varga [Tue, 19 Feb 2019 10:22:49 +0000 (11:22 +0100)]
Check for nested augmentations

When we are augmenting an already-conditional-augmented node from
the same module, we should inherit the previous when statement.

JIRA: YANGTOOLS-956
Change-Id: Ia3c04d60f4975bd721406b26aa4c2e7d8b05122b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for writing mountpoints to JSON 55/83255/1
Robert Varga [Thu, 25 Jul 2019 15:59:35 +0000 (17:59 +0200)]
Add support for writing mountpoints to JSON

This adds basic support for emitting mountpoints into JSON documents,
as otherwise we cannot translate XML-to-JSON, which hampers the usual
use case of NETCONF-to-RESTCONF transformation.

JIRA: YANGTOOLS-1013
Change-Id: I9e29050384ba344804538d4155175908c9ed6697
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd rename fixmes to NormalizedNodeStreamWriterExtensions 54/83254/1
Robert Varga [Thu, 25 Jul 2019 15:53:15 +0000 (17:53 +0200)]
Add rename fixmes to NormalizedNodeStreamWriterExtensions

The extension for Anydata is known as AnydataExtension, it makes
sense to keep naming consistent. Drop a few FIXMEs to that effect.

Change-Id: Ic2b848cd96d0d32a540bb2d10d82a80e0f0d2648
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd DatastoreIdentifier 53/83253/2
Robert Varga [Thu, 25 Jul 2019 15:40:19 +0000 (17:40 +0200)]
Add DatastoreIdentifier

This is a type-safe manifestation of RFC8342 datastore identity
for the purposes of yang-data-api. While this identifier not
immediately used in any contracts, it will be required for
RFC8525/RFC8528 interoperation where codecs are concerned.

JIRA: YANGTOOLS-1012
Change-Id: Ief45ed176d5751dc22249d3c40da2473f648bbc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPackage RFC8528 extensions in odl-yangtools-data-api 51/83251/1
Robert Varga [Thu, 25 Jul 2019 13:28:19 +0000 (15:28 +0200)]
Package RFC8528 extensions in odl-yangtools-data-api

These are pulled into the implementation package, whereas we really
want to have them in the api package.

Change-Id: Ibfaa05586da9e7b8abb2aea13db24775ba285ffc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd MountPointNormalizedNodeWriter 40/83240/1
Robert Varga [Wed, 24 Jul 2019 16:48:27 +0000 (18:48 +0200)]
Add MountPointNormalizedNodeWriter

With the advent of MountMointNode a NormalizedNode tree can contain
nested mount point data, which is not quite a regular node.

This patch introduces a utility NormalizedNodeWriter, which can
either filter or forward MountPointNodes through a NormalizedNode
stream.

JIRA: YANGTOOLS-1010
Change-Id: Ie8cf6efa0874864461aa761b8a9c6e74a250bbac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTeach InstandIdToNodes about AnydataNode 38/83238/1
Robert Varga [Wed, 24 Jul 2019 15:18:47 +0000 (17:18 +0200)]
Teach InstandIdToNodes about AnydataNode

This mirrors the capability of anyxml nodes, hence the data can
be queried.

Change-Id: Ib4b1f13ebbc1a6b8eb8b41ab6cc918d5533a59b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd NodeIdentifierWithPredicates.getValue() 30/83230/1
Robert Varga [Wed, 24 Jul 2019 10:23:33 +0000 (12:23 +0200)]
Add NodeIdentifierWithPredicates.getValue()

Acquiring a particular value is useful for code which extracts
values out of a YangInstanceIdentifier -- as these mirror corresponding
leaves.

Change-Id: I6a1613315489cb0219225b344f266cf31cd88815
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractMountPointContextFactory 20/83220/2
Robert Varga [Tue, 23 Jul 2019 23:58:44 +0000 (01:58 +0200)]
Add AbstractMountPointContextFactory

This factory has model-specific information about RFC8528, so that
it is able to form an accurate view of mount points defined by inline
data.

Change-Id: I3350403c3fb3e1e074649536511eb7935f0ff6c9
JIRA: YANGTOOLS-1010
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions for 3.0.4-SNAPSHOT 83/83083/1
Robert Varga [Thu, 18 Jul 2019 05:37:50 +0000 (07:37 +0200)]
Bump versions for 3.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I1c5be6a304bbdbae706fb39b4cbcb6b9510cca25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor MountPoint-related definitions 65/83065/11
Robert Varga [Tue, 16 Jul 2019 13:23:14 +0000 (15:23 +0200)]
Refactor MountPoint-related definitions

At data-api level we have an opinionated view of how
the underlying mount point looks like and unify the semantics
of a mount point.

Notably we have a MountPointContext, which provides an entrypoint
into the mount point resolution process, which can be dynamically
constructed from inlinee parser data.

This simplifies things by quite a bit, getting rid of unneeded
abstractions in the process.

JIRA: YANGTOOLS-1007
Change-Id: I6419d13b8a84a4cdf5cc7707dba039c33f8d3f39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove MountPointChild to rfc8528-data-api 63/83063/1
Robert Varga [Tue, 16 Jul 2019 13:10:10 +0000 (15:10 +0200)]
Move MountPointChild to rfc8528-data-api

This concept encapsulates a potential NormalizedNode and is needed
for mount point schema resolution. Move it to data-api.

Change-Id: I26917007488070dbb664eaaf82d11eeae62ae425
JIRA: YANGTOOLS-1007
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpecial-case schema-mount nodes 58/83058/3
Robert Varga [Tue, 16 Jul 2019 09:56:50 +0000 (11:56 +0200)]
Special-case schema-mount nodes

We need to recognize yangmnt:schema-mounts before we start emitting
the mount point data, as it may be required for nested mountpoint
resolution.

JIRA: YANGTOOLS-1007
Change-Id: Iee2b3ab7ddc4f2ae2416d01a8554fc7ec11cc6ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove YangLibraryConstants 56/83056/5
Robert Varga [Tue, 16 Jul 2019 08:36:38 +0000 (10:36 +0200)]
Move YangLibraryConstants

These constants are only needed at data-api layer, move them.

JIRA: YANGTOOLS-1007
Change-Id: I2f53b5dcf8302d833e252f1022396ddbc5d0cb94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd ImmutableMountPointNormalizedNodeStreamWriter 12/83012/15
Robert Varga [Wed, 10 Jul 2019 22:22:25 +0000 (00:22 +0200)]
Add ImmutableMountPointNormalizedNodeStreamWriter

This is an immutable writer, which is able to receive mount points
from a stream and turns them into MountPointNodes.

JIRA: YANGTOOLS-1010
Change-Id: I1c89c757b25ac58632d8183df12e77427511ee9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate MountPointSchemaResolver 52/83052/5
Robert Varga [Mon, 15 Jul 2019 20:12:32 +0000 (22:12 +0200)]
Eliminate MountPointSchemaResolver

MountPointSchemaResolver really deals with mount point data
instantiation. This means is really needs to live at the data-api
layer instead of model-api layer -- but it turns out we have a
mirror in MountPointNodeFactory, hence we just converge on that
interface instead.

JIRA: YANGTOOLS-1007
Change-Id: I69f1d2c11239f48d22a0d2d184604e5518e50354
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoInclude RFC85258 API documentation 51/83051/3
Robert Varga [Mon, 15 Jul 2019 20:14:23 +0000 (22:14 +0200)]
Include RFC85258 API documentation

This was missed, add the corresponding sections.

JIRA: YANGTOOLS-1007
Change-Id: Icc6a2c20f350ef29deacec90a579ba61d329e7aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd XML support for parsing schema-mount data 48/82748/41
Robert Varga [Wed, 26 Jun 2019 13:06:12 +0000 (15:06 +0200)]
Add XML support for parsing schema-mount data

When we cannot find a direct descendant of a particular schema,
we can still interpret it as a schema-mounted element, if the
corresponding schema allows for that.

JIRA: YANGTOOLS-1007
Change-Id: I1e595fafcc0aa1cd41c2cc6afc469d5152953dc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd MountPointNode and its specializations 82/82982/28
Robert Varga [Tue, 9 Jul 2019 20:29:38 +0000 (22:29 +0200)]
Add MountPointNode and its specializations

MountPointNode is a utility construct to carry a NormalizedNode
tree with mount point content attached.

JIRA: YANGTOOLS-1010
Change-Id: Ie33cd6e566584191d20f942eeb87ce6145e30717
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoIntroduce MountPointIdentifier 11/83011/10
Robert Varga [Wed, 10 Jul 2019 19:25:17 +0000 (21:25 +0200)]
Introduce MountPointIdentifier

For the purposes of streaming mount points out, we need to form
a proper identifier namespace -- MountPointIdentifier does exactly
that, improving type-safety.

This is a first step in a larger-scale refactor to clean up the
interactions between the parser and the writer.

JIRA: YANGTOOLS-1007
Change-Id: Ie3d0125c3e6c4ff795f3492b025fa00bc2b145b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRetrofit mount-point awareness into yang-data-util 77/82977/20
Robert Varga [Tue, 9 Jul 2019 10:57:04 +0000 (12:57 +0200)]
Retrofit mount-point awareness into yang-data-util

{Container,ListEntry}NodeDataWithSchema can potentially contain
out-of-band mount point data, which needs intermediate processing
once all data has been acquired.

We introduce AbstractMountPointDataWithSchema as a common superclass,
which optionally holds MountPointData.

MountPointData contains enough information to resolve the data nodes
in the context of a schema context supplied either statically or
dynamically (based on the mount data).

JIRA: YANGTOOLS-1007
Change-Id: I08ba4dcf3aaf758f12b42e625d9d17a774d07825
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractIdentifiable 83/82983/4
Robert Varga [Tue, 9 Jul 2019 22:41:35 +0000 (00:41 +0200)]
Add AbstractIdentifiable

This utility class allows us to share Identifiable implementation
subclasses. This reduces the number of implementations present.

Change-Id: I87132f0b434339a55c4911c96affabb2afb67602
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AbstractSchemaContextProvider 81/82981/4
Robert Varga [Tue, 9 Jul 2019 21:29:53 +0000 (23:29 +0200)]
Add AbstractSchemaContextProvider

In most SchemaContextProvider cases we are dealing with a constant
SchemaContext. Codify that in AbstractSchemaContextProvider.

Change-Id: If4e8fea593ab30d10da0d206b379aba407627677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix yang-parser-rfc7950 module name 78/82978/1
Robert Varga [Tue, 9 Jul 2019 12:00:32 +0000 (14:00 +0200)]
Fix yang-parser-rfc7950 module name

The bundle has wrong Automatic-Module-Name, fix that up.

Change-Id: Ieb6821dac0ea8ab8130fc498b7e032eb174890b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd rfc8528-data-api 76/82976/2
Robert Varga [Tue, 9 Jul 2019 09:39:25 +0000 (11:39 +0200)]
Add rfc8528-data-api

Mount points require a rather complex interaction with
NormalizedNodeStreamWriter, which is defined in a new artifact.

Change-Id: If3063151c7eca561b5382e2da6ddc339cba94e4f
JIRA: YANGTOOLS-1007
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd YangLibraryConstants 75/82975/2
Robert Varga [Tue, 9 Jul 2019 09:30:43 +0000 (11:30 +0200)]
Add YangLibraryConstants

RFC8528's data representation rules require components dealing with
mountpoints on both schema and data levels to recognize
ietf-yang-library data for the purposes of interpretation of other
contained data. This patch adds the minimum information required
to identify the data items required.

Change-Id: I9be2e1d6527d316a475dc1e47d7670e75383810b
JIRA: YANGTOOLS-1007
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAllow statements to efficiently lookup actions/notifications 43/82943/1
Robert Varga [Mon, 8 Jul 2019 08:58:40 +0000 (10:58 +0200)]
Allow statements to efficiently lookup actions/notifications

As actions and notifications are part of schema tree, we can reuse
that namespace to efficiently look them up.

Change-Id: I07d6dcc44648fb74c774a7437743db486e444a62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAllow actions/notifications to be efficiently looked up 20/82920/4
Robert Varga [Wed, 3 Jul 2019 22:34:51 +0000 (00:34 +0200)]
Allow actions/notifications to be efficiently looked up

It is quite common to look up actions/notifications through
their QName. Add a method to look them up directly to
{Action,Notification}NodeContainer.

Change-Id: Ib643f60b932e6298f95aaaf67981347104c4299f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake sure root JSON context is properly flushed 68/82868/9
Anna Bencurova [Mon, 1 Jul 2019 13:34:05 +0000 (15:34 +0200)]
Make sure root JSON context is properly flushed

If we are dealing with an exclusive context which contains
only children which can be skipped, we can end up attempting
to close the context without it first having been emitted,
leading to a GSON splat.

In order to fix this, we need make sure we do not directly
emitEnd(), but rather endNode() -- so that the context can
emit its starts if it has not done so.

JIRA: YANGTOOLS-1008
Change-Id: I02452abe24c7a42b83246a113f284990f6211d9f
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUnify ComplexJson SchemaContext references 29/82929/2
Robert Varga [Thu, 4 Jul 2019 10:34:52 +0000 (12:34 +0200)]
Unify ComplexJson SchemaContext references

This introduces AbstractComplexJsonTest, which maintains the schema
context for complexjson models and the corresponding codec factory.

Change-Id: I667fd5274a6e315679854e79389a42c93d3d72eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpecialize SchemaPath.create(boolean, QName) 19/82919/1
Robert Varga [Wed, 3 Jul 2019 22:30:16 +0000 (00:30 +0200)]
Specialize SchemaPath.create(boolean, QName)

As it turns out we use single-QName variant quite heavily, this
provides a specialized method, which does not have varargs.

Change-Id: I5a3f1bc7379fe6c387fd8d0fb3cfb9cef0139c72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSplit uint factory methods 10/82910/1
Robert Varga [Wed, 3 Jul 2019 12:49:45 +0000 (14:49 +0200)]
Split uint factory methods

This splits up internal methods lookup methods, so that they are
more easily inlined. Also mark cache access as potential VarHandle
users.

Change-Id: I1892290d347fba9e662394fda0ca5ce4394514d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.1 36/82636/4
Robert Varga [Fri, 21 Jun 2019 05:15:09 +0000 (07:15 +0200)]
Bump odlparent to 5.0.1

This picks up the next odlparent release.

Change-Id: I189d00c83577c602acfd25053e6b35bf20d18123
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd prerequisiteUnavailable() 09/74809/10
Robert Varga [Fri, 3 Aug 2018 18:37:30 +0000 (20:37 +0200)]
Add prerequisiteUnavailable()

This method should be invoked when we know the prerequisite is
not available. This adds the very basic notion and hooks for that.

Change-Id: Ibdb7a04737292be1f3a091057601af7db8325a38
JIRA: YANGTOOLS-859
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoHandle implicit parent statements during copy operations 38/68838/30
Robert Varga [Tue, 27 Feb 2018 20:01:27 +0000 (21:01 +0100)]
Handle implicit parent statements during copy operations

Rather than special-casing choice nodes, make sure we create a proper
implicit statement when effective nodes are being introduced.

JIRA: YANGTOOLS-724
Change-Id: I5c2f26df31ba78623cd1dd156710f3a12db8c671
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse assertThat(isA()) instead of assertTrue(instanceof) 59/82759/1
Robert Varga [Thu, 27 Jun 2019 10:30:44 +0000 (12:30 +0200)]
Use assertThat(isA()) instead of assertTrue(instanceof)

This improves errors reported when tests are failing, which is
a good thing.

Change-Id: I9ac82a7915de2faced58401f77fc0707a31b2754
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd a nullness annotation 49/82749/1
Robert Varga [Wed, 26 Jun 2019 15:57:16 +0000 (17:57 +0200)]
Add a nullness annotation

Effective mountpoint statement has to have a non-null path,
this adds the annotation to express that.

Change-Id: I85d3ee89b2334cb39351811d733d7aa02a59e8bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd explicit serialization format 54/82654/9
Robert Varga [Fri, 21 Jun 2019 23:47:42 +0000 (01:47 +0200)]
Add explicit serialization format

Having control over the entries that go in and out we get to choose
what sorts of maps are we going to use.

Change-Id: I7cb47c2452752ca046dbc0451c828ca3ba49193f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate off of deprecated NodeIdentifierWithPredicates methods 82/82682/1
Robert Varga [Mon, 24 Jun 2019 12:09:05 +0000 (14:09 +0200)]
Migrate off of deprecated NodeIdentifierWithPredicates methods

This migrates to replacement methods, eliminating warnings.

Change-Id: Iaa15e588f20b6cdc1f6fc63b45d6dacb116fa67d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate off of deprecated NodeIdentifierWithPredicates methods 77/82677/1
Robert Varga [Mon, 24 Jun 2019 08:45:45 +0000 (10:45 +0200)]
Migrate off of deprecated NodeIdentifierWithPredicates methods

This migrates to replacement methods, eliminating warnings.

Change-Id: I2862aec39ebfbcdc1f762e2868f6b84ebe2c72a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd SharedSingletonMap.getEntry() 05/82605/1
Robert Varga [Thu, 20 Jun 2019 14:19:09 +0000 (16:19 +0200)]
Add SharedSingletonMap.getEntry()

This adds access to the single entry being present in the map,
without the need to encapsulate it via entrySet().

Change-Id: Ifbb101285bb4825237fceb37db025334b1307c0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeduplicate concurrent SchemaContext loads 90/82490/3
Robert Varga [Tue, 11 Jun 2019 16:53:18 +0000 (18:53 +0200)]
Deduplicate concurrent SchemaContext loads

In case we are running concurrent SchemaContext computation, if
the result is not cached we will have multiple results. These
need to be reconciled with the cache, so that those results will
be squashed into a single instance.

JIRA: YANGTOOLS-1004
Change-Id: I82df2b32a534d0acc803548579fb8ad138853c68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 3.0.3-SNAPSHOT (again) 02/82502/1
Robert Varga [Wed, 12 Jun 2019 09:42:32 +0000 (11:42 +0200)]
Bump versions to 3.0.3-SNAPSHOT (again)

This starts the next development iteration.

Change-Id: I35551bbd2ea36e65e36ca88eaec9be966a643d85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix version mis-bump 01/82501/1
Robert Varga [Wed, 12 Jun 2019 09:41:35 +0000 (11:41 +0200)]
Fix version mis-bump

These instances were not properly bumped, fix that.

Change-Id: Ia057bd0823b16198cf184f20b22f571a8cb5aeb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRevert "Bump versions to 3.0.3-SNAPSHOT" 00/82500/1
Robert Varga [Wed, 12 Jun 2019 09:41:13 +0000 (11:41 +0200)]
Revert "Bump versions to 3.0.3-SNAPSHOT"

This reverts commit 7ec04bfab1274091de745f29f2c4ee00e550ebe4.

Change-Id: I4fc92a77262194e3416db51c552990b895e6836c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 3.0.3-SNAPSHOT 94/82494/1
Robert Varga [Wed, 12 Jun 2019 00:43:14 +0000 (02:43 +0200)]
Bump versions to 3.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I6a454b23fd831606a64beec8e1d6b1370e7c3913
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRecognize AnyDataSchemaNode 83/82483/2
Robert Varga [Tue, 11 Jun 2019 09:18:45 +0000 (11:18 +0200)]
Recognize AnyDataSchemaNode

CompositeNodeDataWithSchema needs to recognize anydata nodes and
not fall back to a generic.

Change-Id: Id545fde1f4911754ceb1a8a63c8519125206afba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEmit end of anyxml data 50/82450/3
Robert Varga [Fri, 7 Jun 2019 14:33:56 +0000 (16:33 +0200)]
Emit end of anyxml data

Since we are emitting the start of anyxml node, and we have fixed
the thinko in 36326770d563bfe2a5332738b02e66d6132574a9, we also
need to emit its end.

JIRA: YANGTOOLS-1002
Change-Id: I5e8497cd33ad4be270d5e9b5366e39c04e017486
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix DOMSourceAnydata normalization 54/82354/9
PeterSuna [Fri, 31 May 2019 12:53:49 +0000 (14:53 +0200)]
Fix DOMSourceAnydata normalization

Internal DOMSource contains nested a top-level element, which acts
as a container for internal nodes. We need to skip this element
when we are attempting to parse the content, otherwise we will end
up with incorrect schema/data nesting.

Change-Id: Iaa2c799a2437dadf9ee2735092e1346d1f275d55
Signed-off-by: PeterSuna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnd anydata element 48/82448/5
Robert Varga [Fri, 7 Jun 2019 13:41:54 +0000 (15:41 +0200)]
End anydata element

Since startAnydata() is opening an element we must make sure
we close it again. This flushes out a thinko around tracking
endElement depth, which must be decremented before check.

JIRA: YANGTOOLS-1002
Change-Id: I8f0b31eb9f165d384c1e680e5fc19763e9f67fbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFlush element when streaming NormalizedAnydata 47/82447/2
Robert Varga [Fri, 7 Jun 2019 13:39:08 +0000 (15:39 +0200)]
Flush element when streaming NormalizedAnydata

We must make sure parent StreamWriterFacade emits any started
open elements to the writer, otherwise can end up with weird
XML, which suddenly emits a self-closing element.

Issue a flushElement() before writing the data.

JIRA: YANGTOOLS-1002
Change-Id: Ib3933ddad22e490782a144306b8df10a033d74ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove dead code from StreamWriterFacade 46/82446/1
Robert Varga [Fri, 7 Jun 2019 13:29:08 +0000 (15:29 +0200)]
Remove dead code from StreamWriterFacade

This code was leftover from the opaque anydata implementation
and does not serve any purpose, hence kill it.

Change-Id: I58c1ebcfc4677cfdeec85770fcaa1024f18859e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd sibling serialization test 41/82441/2
Robert Varga [Fri, 7 Jun 2019 09:37:47 +0000 (11:37 +0200)]
Add sibling serialization test

This adds the model update and a simple test for sibling
serialization boundaries.

Change-Id: I0f67626f56d86bbbfd02486c376b66efabd3b81c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake ReusableImmutableNormalizedNodeStreamWriter reuse leaf builders 22/82422/2
Robert Varga [Thu, 6 Jun 2019 13:42:50 +0000 (15:42 +0200)]
Make ReusableImmutableNormalizedNodeStreamWriter reuse leaf builders

LeafSetEntryNode and LeafNode cannot have children, hence we can
easily reuse their instances.

Change-Id: Ic347a3e89648d6a67ca81dc65c6c320647b078b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpose ReusableStreamReceiver 16/82416/4
Robert Varga [Thu, 6 Jun 2019 10:23:49 +0000 (12:23 +0200)]
Expose ReusableStreamReceiver

ReusableImmutableNormalizedNodeStreamWriter has two properties
which are not inherently tied to it being bound to immutable nodes:
- it can have its state reset
- it exposes a NormalizedNode result of a streaming session

Expose these traits as ReusableStreamReceiver, so that users
can use the API rather than the implementation.

Change-Id: I841211c89520c4a5c67d436c8a49d719e8f7f1b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate NodeIdentifierWithPredicates.getKeyValues() 47/82347/4
Robert Varga [Thu, 30 May 2019 23:42:54 +0000 (01:42 +0200)]
Deprecate NodeIdentifierWithPredicates.getKeyValues()

Map vieew is not necessary, as it leaks hashCode()/equals(),
preventing us from optimizing the layout of the structure.

This patch introduces alternative method for accessing predicates
without relying on Map, while retaining the possibility of getting
a Map view.

Change-Id: Ieb2c8794056fe481d4905862e30fe0601c2ab152
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove AbstractPathArgument.hashCodeGuard 45/82345/2
Robert Varga [Thu, 30 May 2019 21:42:18 +0000 (23:42 +0200)]
Remove AbstractPathArgument.hashCodeGuard

This patch removes the explicit boolean guard around hashCode,
which guarantees disambiguation between 0 and uncomputed.

The single byte expended here has an actual cost of 7 bytes,
as it is forcing all subclasses to have a padding of 7 with
default settings in most environments.

This changes instance sizes as follows (32bit/64bit):

NodeIdentifier                24(3)/32(7) -> 24(4)/24(0)
NodeIdentifierWithPredicates  32(7)/40(7) -> 24(0)/32(0)
NodeWithValue                 32(7)/40(7) -> 24(0)/32(0)

Most notable here is the reduction of
NodeIdentifierWithPredicates, which cannot reasonably be
shared, as it depends on user data.

Change-Id: Ia444cf708f5209cb22f2661e48f2f2ffaf150281
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 3.0.2-SNAPSHOT 58/82258/6
Robert Varga [Mon, 27 May 2019 19:12:02 +0000 (21:12 +0200)]
Bump versions to 3.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I74d4e84d0c9a2c9f2cf8c0cd131175280b71e2bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup testing AugmentationIdentifier instantiations 41/82341/2
Robert Varga [Thu, 30 May 2019 17:06:07 +0000 (19:06 +0200)]
Cleanup testing AugmentationIdentifier instantiations

Using ImmutableList.of() is slightly faster, use that.

Change-Id: Ia45d18dc840e8985a1037e7235c01da5f873d870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AugmentationIdentifier.create() methods 40/82340/2
Robert Varga [Thu, 30 May 2019 17:03:24 +0000 (19:03 +0200)]
Add AugmentationIdentifier.create() methods

This adds two flavors of AugmentationIdentifier.create(), which
use a global weak cache for normalizing AugmentationIdentifiers.

The cache is carefully populated, i.e. it makes a point of using
immutable keys only.

JIRA: YANGTOOLS-998
Change-Id: I1e7d65b995e50773ec2260c9fb01bc1c6bbaafbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate NodeIdentifierWithPredicates constructors 39/82339/2
Robert Varga [Thu, 30 May 2019 16:44:15 +0000 (18:44 +0200)]
Deprecate NodeIdentifierWithPredicates constructors

Provide static factory methods for instantiating
NodeIdentifierWithPredicates, so that we can deprecate public
constructors, allowing us to evolve the class itself.

JIRA: CONTROLLER-1000
Change-Id: I05916b45c2c94caab717ae96b699ca2b264cc2da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCreate unit test for anydata. 82/82282/10
PeterSuna [Tue, 28 May 2019 15:50:53 +0000 (17:50 +0200)]
Create unit test for anydata.

-Add test for Serialization (Fail)
-Add test for Deserialization (Pass)

Change-Id: Ic7de2373f1a4effbedce35aded6b6223dac3c9ab
Signed-off-by: PeterSuna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd ImmutableMetadataNormalizedAnydata.ofOptional() 33/82333/1
Robert Varga [Thu, 30 May 2019 10:09:06 +0000 (12:09 +0200)]
Add ImmutableMetadataNormalizedAnydata.ofOptional()

The only user of ImmutableMetadataNormalizedAnydata is using it
only optionally, based on metadata presence. This indicates a static
factory method is usable more than the plain constructor.

Change-Id: I0379fd89acfcf6d12264da9cbb041da772449988
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd missing @NonNull annotations 32/82332/1
Robert Varga [Thu, 30 May 2019 10:08:19 +0000 (12:08 +0200)]
Add missing @NonNull annotations

Static factories are missing these annotations, making downstreams'
life harder.

Change-Id: I8a8ccaf19e32b01efa5037a09dcee4cab078f72d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDocument and fix DOMSourceAnydata streaming 21/82321/2
Robert Varga [Wed, 29 May 2019 23:50:00 +0000 (01:50 +0200)]
Document and fix DOMSourceAnydata streaming

W3C DOM requires each document to have a single root element, and
we are using the anydata element as the container. This is required
because anydata (and anyxml) can hold a list, in which case we would
be faced with a document which has multiple root elements.

Document this fact and adjust streaming interfaces/handling to take
this into account.

JIRA: YANGTOOLS-993
Change-Id: Ifcc7777d60359c942b8f033307ab63295525ca1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor anydata-related interfaces 20/82320/3
Robert Varga [Wed, 29 May 2019 22:20:06 +0000 (00:20 +0200)]
Refactor anydata-related interfaces

As it turns out we need to expose more of our capabilities into
the API interface, as otherwise we cannot link the functionality
in javadoc.

This refactors interfaces/implementations, allowing redirection.

JIRA: YANGTOOLS-993
Change-Id: I142c9d50247d32d3ce24cb03e739618246a35a95
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd AugmentationIdentifier(ImmutableSet) 07/82307/1
Robert Varga [Wed, 29 May 2019 12:57:45 +0000 (14:57 +0200)]
Add AugmentationIdentifier(ImmutableSet)

There are situations where we know input is an ImmutableSet,
expose a constructor to wire such calls directly.

Change-Id: Id1ae48ee64c88119767c7e538a3379f5bdcb257c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup NormalizedAnydata 59/82259/5
Robert Varga [Mon, 27 May 2019 20:01:57 +0000 (22:01 +0200)]
Cleanup NormalizedAnydata

NormalizedAnydata is used only with conjuction with SchemaContext
and DataSchemaNode, make sure users don't have to just through
hoops.

This also fixes SchemaTracker integration by providing a utility
single-child parent for use with the specified context node as well
as fixing support for streaming metadata.

JIRA: YANGTOOLS-995
Change-Id: I11b4ac769c8d54faddc19eab3d094b2ba4f43aa3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd JSON support for normalized anydata 03/82203/12
Robert Varga [Mon, 27 May 2019 08:58:51 +0000 (10:58 +0200)]
Add JSON support for normalized anydata

Since we have an entrypoint which can introduce anydata in the
system, JSON codec needs to be able to emit normalized anydata.

JIRA: YANGTOOLS-997
Change-Id: Ia8aa38553e37786f0358cb5888a16c3d1cfd4704
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd support for Anydata content normalization 54/82154/31
Robert Varga [Mon, 27 May 2019 10:52:23 +0000 (12:52 +0200)]
Add support for Anydata content normalization

In order to transport anydata payloads between parser-based
representations, we need to normalize it and attach a proper
DataSchemaContextTree/DataSchemaContextNode to the structure,
so that the contained data can be properly interpreted.

This patch adds NormalizedAnydata representation, which captures
this information and teaches the XML codec to handle transaformations
to/from the normalized form.

JIRA: YANGTOOLS-995
Change-Id: I3403db3a0250290505c405b5775601d47aadcbbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework Anydata model 94/82194/17
Robert Varga [Tue, 21 May 2019 14:22:20 +0000 (16:22 +0200)]
Rework Anydata model

AnydataNodes cannot really be made opaque due to stateful nature
of their representation in XML. While we can work around identifiers
by capturing their namespace specification, we cannot work around
identity and instance-identifier codecs, which require full namespace
declaration being available.

Since we cannot understand the value parsing until the content is
bound to a particular model, which may actually never happen, we would
have to lug around the entire NamespaceContext for each node
encountered -- and that is not quite feasible.

This patch takes the escape route by embracing the fact that streamers
and anydata instances need to hash out their streaming properties
themselves.

JIRA: YANGTOOLS-993
Change-Id: If1118902394afb651cfbee3313b2810cdf4e1231
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCreate unit tests for anydata implemetnation. 25/82225/3
PeterSuna [Thu, 23 May 2019 14:14:08 +0000 (16:14 +0200)]
Create unit tests for anydata implemetnation.

- Add parse anydata test from yang file.
- Add test for anydata in testDeviateAdd.

Change-Id: I1647274eab97390247aa06a73f28a77e98e7b4d0
Signed-off-by: PeterSuna <peter.suna@pantheon.tech>