yangtools.git
6 years agoMark missed StatementStreamSource methods 79/68679/2
Robert Varga [Sun, 25 Feb 2018 22:13:02 +0000 (23:13 +0100)]
Mark missed StatementStreamSource methods

We have failed to mark methods in this interface for API movement
before 2.0.0, hence they were left out. Mark them for 3.0.0 so we
do not forget again.

Change-Id: Ic24e12e6f9c984f6d92d53aeb2aa38f542306beb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEncapsulate YangStatementParserListenerImpl.walk() 76/68676/2
Robert Varga [Sun, 25 Feb 2018 20:02:35 +0000 (21:02 +0100)]
Encapsulate YangStatementParserListenerImpl.walk()

As it turns out, the contract between YangStatementStreamSource
is one of walking a tree with a set of parameters. Make sure we
encapsulate this contract, so that it can be efficiently implemented
using a visitor.

This has the benefit of discarding unneeded state more quickly
and not retaining it past errors. It will also allow us to very
simply convert YangStatementParserListenerImpl into a visitor.

JIRA: YANGTOOLS-713
Change-Id: Iac8c4979fb31cb527788837b41d4bbf17ce4b3cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoPrivatize YangStatementParserListenerImpl 75/68675/2
Robert Varga [Sun, 25 Feb 2018 19:34:18 +0000 (20:34 +0100)]
Privatize YangStatementParserListenerImpl

This class is package-visible, hence public methods should only be
the @Override ones.

JIRA: YANGTOOLS-713
Change-Id: Id092b12cf6f2ad309aaf5920b31ae9fb4ab25b58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMake QName/QNameModule a WritableObject 74/68674/2
Robert Varga [Sun, 25 Feb 2018 18:43:49 +0000 (19:43 +0100)]
Make QName/QNameModule a WritableObject

Serializing these objects into a stream is useful, make them implement
WritableObject.

Change-Id: I3fbb147b4deb17afb2ead0dedc716e5a9a5cefc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoQNameModule/QName should implement Identifier 73/68673/2
Robert Varga [Sat, 24 Feb 2018 21:42:24 +0000 (22:42 +0100)]
QNameModule/QName should implement Identifier

These classes are inherently identifier-like, and hence should be
implementing Identifier concept.

Change-Id: Ic494ec42788a176555c56446105511bc4868fad8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoExpose identities from ModuleEffectiveStatement 51/68551/2
Robert Varga [Fri, 23 Feb 2018 15:03:39 +0000 (16:03 +0100)]
Expose identities from ModuleEffectiveStatement

Parser has an accurate, indexed view of all identities defined in
a particular module. Expose this namespace to ModuleEffectiveStatement
users.

Change-Id: I9692cb91b23155191545224bceaf436fd0f6c67e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEliminate unneeded @BeforeClass 41/68541/4
Robert Varga [Fri, 23 Feb 2018 12:02:55 +0000 (13:02 +0100)]
Eliminate unneeded @BeforeClass

Constructing QNames does not entail exceptions, so we can initialize
them as simple constants.

Change-Id: I84fa394cda4d8478b60a40b8ea7080d4e6b88558
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoReport parent SchemaPath on error 39/68539/1
Robert Varga [Fri, 23 Feb 2018 11:22:28 +0000 (12:22 +0100)]
Report parent SchemaPath on error

When we fail to find a child node, report the full schemapath
of the parent node, so the input can be properly diagnosed.

Change-Id: Id5cf3f55f3c745b55f2a485746dd995b0f056657
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCorrect error message 38/68538/1
Robert Varga [Fri, 23 Feb 2018 11:21:58 +0000 (12:21 +0100)]
Correct error message

Expand "doesn't" to "does not".

Change-Id: I2b530985dd5982d7bcbc95866c1e7e26e52c4b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize QNameModule.equals() a bit 96/68496/1
Robert Varga [Thu, 22 Feb 2018 13:42:48 +0000 (14:42 +0100)]
Optimize QNameModule.equals() a bit

The namespace cannot be null, so we can safely call equals() on it,
skipping checks in Objects.equals().

Change-Id: Ic1b94e2239fb9fd906711c8cbb03dd252a190c49
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSpeed up JSON codec operations 93/68493/2
Robert Varga [Thu, 22 Feb 2018 13:02:42 +0000 (14:02 +0100)]
Speed up JSON codec operations

With the improved SchemaContext, we can perform direct lookup
of Module based on QNameModule -- use that instead of iteration.

Change-Id: Ib5c1146b8c13ac3f52a18ed8334b89b66f6ca40c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix maven plugin ignoring import resolution mode 66/67866/10
Robert Varga [Sat, 3 Feb 2018 19:20:52 +0000 (20:20 +0100)]
Fix maven plugin ignoring import resolution mode

While BasicCodeGenerator has knobs to express required import resolution
mode, the plugin ignores them. This patch reorganizes YangToSourcesProcessor
so that we determine what import resolution mode we need before we start
assembling the SchemaContext.

JIRA: YANGTOOLS-825
Change-Id: Iaec12e3c8ada2173262533cc6d59e54f18095826
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDo not fake an errorMessage for pattern constraints 64/68464/4
Robert Varga [Wed, 21 Feb 2018 13:51:03 +0000 (14:51 +0100)]
Do not fake an errorMessage for pattern constraints

Eagerly-formatting a replacement error message is actively hurting
callers of getErrorMessage(), which really expect that method
to return model-defined error message. Fix that.

JIRA: YANGTOOLS-850
Change-Id: Iddb5f9ae529f1ed49eed735a8931ee396334f578
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd DeclaredStatementFormatter 66/68466/2
Robert Varga [Wed, 21 Feb 2018 14:12:26 +0000 (15:12 +0100)]
Add DeclaredStatementFormatter

Working with downstreams it became apparent they really are using
same YangTextBuilder customizations across multiple statements.

This patch exposes DeclaredStatementFormatter, which acts as
a customization holder off of which YangTextSnippets can be created.

JIRA: MDSAL-301
Change-Id: I4733313dcb98c9b1d244088b5b46d8a197ab2f5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoEncapsulate regexes in a non-capturing group 35/68435/4
Robert Varga [Tue, 20 Feb 2018 18:12:19 +0000 (19:12 +0100)]
Encapsulate regexes in a non-capturing group

Regular expressions are pesky, nwo we are being bitten by branches.
Let's just encapsulate the internal pattern into a non-capturing
group and be done with it.

JIRA: YANGTOOLS-798
Change-Id: If3b3b2fb35ecd336bc23fd7acaf29efa48eb9b74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove Bug4079/Bug5410 tests from yang-parser to yang-model-util 56/68456/3
Robert Varga [Wed, 21 Feb 2018 09:43:03 +0000 (10:43 +0100)]
Move Bug4079/Bug5410 tests from yang-parser to yang-model-util

This co-locates the unit test with the class tested.

Change-Id: Ib7d044208946be3347e1b1aedbd87a0cfe1e5a23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove yang-model-export unit tests 21/68421/1
Robert Varga [Mon, 19 Feb 2018 22:49:47 +0000 (23:49 +0100)]
Move yang-model-export unit tests

This will allow us to co-locate within the same package, leading
to better interaction, as we can use package-private methods to look
at state.

Change-Id: I0ab59c32c166505ac44d5f21ae0aa374eaa08aac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd the ability to build effective model 99/68399/2
Robert Varga [Wed, 14 Feb 2018 09:37:11 +0000 (10:37 +0100)]
Add the ability to build effective model

The effective model consists of ModuleEffectiveStatements
which are guaranteed to have unique QNameModules. Express
that in YangParser.

Change-Id: Id094c40cf5dcf49e6289d3b929f4abf2f9cb6436
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd submodule lookup namespace 18/68418/1
Robert Varga [Mon, 19 Feb 2018 20:08:56 +0000 (21:08 +0100)]
Add submodule lookup namespace

ModuleEffectiveStatement needs to allow looking up which submodules
were included as the effect of include statements. Since submodule
names need to be unique, it is natural to express this as a namespace.

Change-Id: I782caba8dfb9ff4dbea5b81e335f06dc797518d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd YANG/YIN namespace string literals 16/68416/2
Robert Varga [Mon, 19 Feb 2018 15:22:54 +0000 (16:22 +0100)]
Add YANG/YIN namespace string literals

Interacting with Java XML machinery requires the use of Strings
for namespaces. It is useful to implement javax.xml.NamespaceContext
with switch() statement, which unfortunately can only work on explicit
string literals. Expose these literals, improving the ergonomics.

Change-Id: I534d2a6e13960ba7587bfe77ed581e8593e65a17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoExport ResourceYangTextSchemaSource 98/68398/2
Robert Varga [Mon, 19 Feb 2018 07:02:52 +0000 (08:02 +0100)]
Export ResourceYangTextSchemaSource

YangTextSchemaSource.forResource() returns this class, which is hidden,
leading to end user confusion, as the return class cannot be imported.

We cannot change the return value, as that would cause ABI breakage,
hence expose ResourceYangTextSchemaSource and mark it for hiding
in next major release.

Change-Id: Ib03e3df73824172dcd80a58fc33f7bdb4e26c6f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd YangTextSnippet to yang-model-export 93/67893/4
Robert Varga [Sat, 3 Feb 2018 19:33:57 +0000 (20:33 +0100)]
Add YangTextSnippet to yang-model-export

This is a simple class generating a sequence of strings, concatenation
of which produces YANG text corresponding to a DeclaredStatement.

The snipped is properly indented, can omit user-specified statements,
and by default omits statements with default values as per RFC6087.

JIRA: MDSAL-301
Change-Id: Ie45e947dccd33b851e23effb827ddc66690451f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd DefaultStatementDefinition 38/67938/1
Robert Varga [Mon, 5 Feb 2018 05:01:34 +0000 (06:01 +0100)]
Add DefaultStatementDefinition

Implementing StatementDefinition contract can be tricky and it is
often misused by using implementation classes. Introduce a utility
default implementation, which enforces statement representations
being interfaces.

Change-Id: Icd2ce998dc8001cfa4a1d44f48017204c6dd02f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoExpose EffectiveModuleStatement prefix mapping 91/67891/8
Robert Varga [Sat, 3 Feb 2018 12:35:24 +0000 (13:35 +0100)]
Expose EffectiveModuleStatement prefix mapping

ModuleEffectiveStatement should expose mapping of prefixes
to imported modules (and self) as well as reverse mapping of
QNameModule to prefix, so that users can map properly map
QNames encountered within a module.

This patch exposes that information via two new namespaces,
which are present only in ModuleEffectiveStatements. Furthermore
EffectiveStatementBase is updated to allow subclasses to contain
namespaces.

JIRA: MDSAL-301
Change-Id: I5139c32eff18c1fa703dd8d3c98882939f82b109
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCorrect double-quoted string whitespace trimming 99/67899/3
Robert Varga [Sun, 4 Feb 2018 15:31:11 +0000 (16:31 +0100)]
Correct double-quoted string whitespace trimming

We need to trim leading and trailing whitespace when it comes from
YANG text, so that the resulting string matches expectations.

This patch adds the required trimming.

JIRA: YANGTOOLS-845
Change-Id: I21777583c5d18819e68c089cd9f2cf51179b0530
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSwitch YangToSourcesProcessor to use YangParser 16/67816/4
Robert Varga [Thu, 1 Feb 2018 12:39:17 +0000 (13:39 +0100)]
Switch YangToSourcesProcessor to use YangParser

Rather than going through YangTextSchemaContextResolver, use
YangParser to assemble the SchemaContext. This gives us better
control over the parsing process and also allows us to build
only sources which are required to generate code in local directory.

JIRA: YANGTOOLS-825
Change-Id: Ie3c49517aedd5ae3604ed27dc5bd1f1f1fa7a4d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDeprecate CopyableNode at al. 52/67752/3
Robert Varga [Tue, 30 Jan 2018 22:48:40 +0000 (23:48 +0100)]
Deprecate CopyableNode at al.

isAddedByUses(), isAugmenting() and similar constructs relate to how
a particular node became effective. This really has not place in the
effective model of the world.

This patch concentrates duplicate methods into an interface hierarchy
and marks them as @deprecated, along with justification. This allows
us to track down users and the semantics they really are after.

Since we are touching SchemaContext, mark its future direction, which
should see it shed a lot of nonsensical methods.

Change-Id: Ibdaf52e45076006e979204ac75e7bae6aeffd29a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoyang-parser-impl supports ASTSchemaSource 11/67811/2
Robert Varga [Thu, 1 Feb 2018 11:27:33 +0000 (12:27 +0100)]
yang-parser-impl supports ASTSchemaSource

yang-parser-rfc7950 supports bridging parsing from ASTSchemaSource,
which is an intermediate product of parsing from YangTextSchemaSource.

Make sure we propagate this capability from YangParserImpl, so that
users can efficiently integrate with it. While we're in the area
teach YangStatementStreamSource how to instantiate itself from
an ASTSchemaSource and add ASTSchemaSource.toString().

Change-Id: I0b6440b6fc4e7522c70261cffcef0afafed8ba53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix invalid enum definition error string 06/67806/1
Robert Varga [Thu, 1 Feb 2018 10:09:35 +0000 (11:09 +0100)]
Fix invalid enum definition error string

This is a copy&paste problem, the string should not be referencing
bits but enums.

Change-Id: I5adc98a5db92b88bf7e20dcc6141213347858f58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMark metainf-services 76/67576/1
Robert Varga [Thu, 25 Jan 2018 15:17:11 +0000 (16:17 +0100)]
Mark metainf-services

Until we get odlparent-3.0.3 with a fixed declaration, fix our features
by marking metainf-services as provided.

Change-Id: If54a0a89dade4e2a4aed4ddf84d0abae5b11fc24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd checkstyle-logging to yangtools-artifacts 42/67342/1
Robert Varga [Fri, 19 Jan 2018 08:50:41 +0000 (09:50 +0100)]
Add checkstyle-logging to yangtools-artifacts

All artifacts should be communicated to downstreams, fix that.

Change-Id: Ida1ca8cfd6162ed7fb54d512b69821df5d666686
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoStart 2.0.2 release cycle 98/67298/1
Robert Varga [Thu, 18 Jan 2018 18:14:51 +0000 (19:14 +0100)]
Start 2.0.2 release cycle

Bump versions by 0.0.1.

Change-Id: I67e5db2ed702ed53336c7ba207c0c89c4b9fa17a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-844: Filtering/SimpleSchemaContext violate getModules() contract 12/67212/13
Robert Varga [Tue, 16 Jan 2018 16:21:50 +0000 (17:21 +0100)]
YANGTOOLS-844: Filtering/SimpleSchemaContext violate getModules() contract

getModules() is explicit about how the modules should be ordered,
which is not compatible with ModuleDependencySort. As it turns out
ModuleDependencySort is only needed in MD-SAL codegen, where we
already invoke it explicitly.

Explicitly sort modules according to requirements of getModules(),
fulfilling that contract.

This also affects findModule(String) and related functions, which
are sorted, but in inverse order of what is specified. Fix that
by adjusting AbstractSchemaContext.REVISION_COMPARATOR and
introducing NAME_REVISION_COMPARATOR for use in places where modules
are not guaranteed to have a unique name.

Change-Id: Ie91685b830694764158381e4696e3f7d5bb57fba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix a nullness thinko 11/67211/2
Robert Varga [Tue, 16 Jan 2018 16:18:04 +0000 (17:18 +0100)]
Fix a nullness thinko

toRevision cannot reasonably be null, as it already is an Optional,
hence the check here is incorrect and should instead check for
non-presence.

Change-Id: I93658ce5993aed1a02f4ad25121e11b3f31d356a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent version to 3.0.2 52/66952/1
Robert Varga [Mon, 8 Jan 2018 19:40:48 +0000 (20:40 +0100)]
Bump odlparent version to 3.0.2

This adopts odlparent 3.0.2 to speed up builds.

Change-Id: If5155e1d070133ccd673efe3d5bb95d97127571a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-841: Fix SchemaContextUtil.findNodeInSchemaContext() 70/66870/3
Robert Varga [Tue, 2 Jan 2018 10:23:44 +0000 (11:23 +0100)]
YANGTOOLS-841: Fix SchemaContextUtil.findNodeInSchemaContext()

When performing recursive node lookup, consider
{Action,Notification}NodeContainers, so that we correctly resolved
nested actions and notifications -- which are new elements in RFC7950
metamodel.

Also generalized RPC input/output lookup to work on actions, too.

Change-Id: I877061c7f0370caf1ed04eb9420a43af3b2d3915
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d027a59601cfbbc912e00e351eeb35a27dcc3bc2)

6 years agoHandling empty text nodes 45/66045/4
Atul Gosain [Wed, 29 Nov 2017 02:07:08 +0000 (18:07 -0800)]
Handling empty text nodes

This is a fix for an issue seen in the patch 63984 on yangtools.
It handles text nodes which are empty.

Change-Id: I6cf1096c511758154df6121d26bf36184385403f
Signed-off-by: Atul Gosain <agosain@luminanetworks.com>
6 years agoYANGTOOLS-766: expand test suite 78/66778/2
Robert Varga [Wed, 27 Dec 2017 15:48:01 +0000 (16:48 +0100)]
YANGTOOLS-766: expand test suite

This patch adds explicit tests for serialization/deserialization
of instance identifiers for both JSONCodecFactorySuppliers.

Change-Id: Id1ba4764573bf2bde566c89c28e2ffc55cb982dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-766: add RFC7951JSONInstanceIdentifierCodec 72/66772/2
Robert Varga [Wed, 27 Dec 2017 01:00:26 +0000 (02:00 +0100)]
YANGTOOLS-766: add RFC7951JSONInstanceIdentifierCodec

RFC7951 non-present prefixes result in last argument namespace reuse,
hence refactor AbstractStringInstanceIdentifierCodec to allow for QNames
to be instantiated using a memoized QNameModule.

The default implementation routes to createQName("", localName), which
preserves backwards compatibility. A specialized subclass
of JSONInstanceIdetifierCodec is created to use memoized QNameModule,
and it is wired to RFC7951 codec supplier.

A similar update is done in AbstractNamespaceCodec, where appendQName()
alternative, which is forwarded the last encountered QNameModule is
added -- the default routes to normal appendQName(), with RFC7951
comparing last QNameModule with current QName's and skipping prefix
serialization if they match.

This is sufficient to make related unit test pass, so remove @Ignore
from it and expand it to assert the decoded YangInstanceIdentifier.

Change-Id: Iec7996d0e1d759623c3cabcbaf0164737afa1649
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-766: introduce JSONCodecFactorySupplier 65/66765/3
Robert Varga [Tue, 26 Dec 2017 10:57:08 +0000 (11:57 +0100)]
YANGTOOLS-766: introduce JSONCodecFactorySupplier

We need two separate instances of JSONCodecFactory factory methods,
each with its own conformance, so that we can properly spin out
codecs compliant to RFC7951 and draft-lhotka-netmod-yang-json-02.

This patch provides a new API entrypoints for specifying these, without
actually providing distinct codecs. It also provides proper JsonParserStream
factory methods which take JSONCodecFactory instead of plain SchemaContext
(and thus assuming JSONCodecFactory implementation).

Change-Id: Ib2b402ed865903432645632e89c9b0e04851a05c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-678: enable empty key verification 64/66764/2
Robert Varga [Tue, 26 Dec 2017 11:21:29 +0000 (12:21 +0100)]
YANGTOOLS-678: enable empty key verification

Now that we are using a non-null value to represent empty leaves,
empty types are a fair game in codecs. Remove @Ignore from JSON/XML
tests which demonstrate the ability to decode empty keys in
YangInstanceIdentifier, which means proper addressing can be done
and works as expected.

Change-Id: Ib0aee3b99d40868d32e62811c2f82c1c42ef0833
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoExpand yang-parser-spi unit tests 60/66760/1
Robert Varga [Mon, 25 Dec 2017 18:41:05 +0000 (19:41 +0100)]
Expand yang-parser-spi unit tests

This patch adds a very basic unit test suite to assert various
aspects of the SPI package.

Change-Id: Ifd68fad33bff3b74579202327b28822b8ce5626d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoImplement Uint{8,16}.valueOf(String, int) 59/66759/2
Robert Varga [Mon, 25 Dec 2017 12:53:37 +0000 (13:53 +0100)]
Implement Uint{8,16}.valueOf(String, int)

This adds a simplistic implementation deferring parsing to
Short/Integer.valueOf(String, int) and performing range checking.

Also expands the test suite to cover Uint{8,16,32,64}, which flushes
out a bug in Uint64's handling of cache slots -- this is fixed, too.

Change-Id: I8fa977028a6f00ee8f25a19fdd2fd5d2b08b4bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd Decimal64.{int,long,short}ValueExact() 58/66758/1
Robert Varga [Mon, 25 Dec 2017 11:58:44 +0000 (12:58 +0100)]
Add Decimal64.{int,long,short}ValueExact()

Add alternative methods which prevent loss of precision by throwing
ArithmeticException. Testing has revealed that valueOf(Integer.MIN_VALUE)
does not work correctly due to the fact negation does results in incorrect
bitmask -- which is fixed by widening conversion.

Change-Id: I206ced685d2edb753507f5d45e29bb6b405ff421
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd Revision test suite 57/66757/1
Robert Varga [Mon, 25 Dec 2017 15:09:48 +0000 (16:09 +0100)]
Add Revision test suite

This adds a simplistic test suite for testing Revision class.

Change-Id: Ibed986f5c53e7f201c3eb16cf448e022b09e6b85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd YangNames test 56/66756/1
Robert Varga [Mon, 25 Dec 2017 14:29:17 +0000 (15:29 +0100)]
Add YangNames test

This adds a simplistic test to ensure YangNames.parseFileName() works
as expected.

Change-Id: Ic619ebdce2a0641418283b4621be4c676341a053
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd YangVersion test 55/66755/1
Robert Varga [Mon, 25 Dec 2017 14:24:44 +0000 (15:24 +0100)]
Add YangVersion test

Add a simple test suite to ascertain YangVersion works as expected.

Change-Id: I52d4d81f25f35443309dae8c93cbc91e705810ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix slf4j usage errors found by checkstyle-logging 46/66446/3
Michael Vorburger [Wed, 13 Dec 2017 23:35:14 +0000 (00:35 +0100)]
Fix slf4j usage errors found by checkstyle-logging

Change-Id: Iff0203d373d33a77ebfe2a8da190e6b927913b4e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoYANGTOOLS-838: detect grouping identifier shadowing 66/66666/2
Robert Varga [Wed, 20 Dec 2017 13:07:21 +0000 (14:07 +0100)]
YANGTOOLS-838: detect grouping identifier shadowing

RFC7950 sections 5.5 and 6.2.1 explicitly forbid identifier
shadowing. Update grouping support to detect and report this
violation.

This patch also fixes typedef support to correctly detect
forward shadowing, when a nested conflicting typedef shadows
a sibling which occurs later in the model text.

Change-Id: I7c67c93c5f13b24657454e13d8b329338f98d7b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix javadoc typo 34/66334/1
Robert Varga [Sun, 3 Dec 2017 13:08:50 +0000 (14:08 +0100)]
Fix javadoc typo

Remove a repeated sentence.

Change-Id: I4d5f8faad2c23fe89bdba0f91847cba10dc76ecb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDrop obsolete Maven site configuration 37/65937/3
Stephen Kitt [Mon, 27 Nov 2017 17:21:05 +0000 (18:21 +0100)]
Drop obsolete Maven site configuration

See
https://lists.opendaylight.org/pipermail/odlparent-dev/2017-November/001492.html

Change-Id: I2735d334673209dd08b677be7de0c4d368e3a8ca
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBump versions to next development cycle 39/65939/1
Robert Varga [Mon, 27 Nov 2017 18:05:38 +0000 (19:05 +0100)]
Bump versions to next development cycle

Change-Id: I3e243ab59fbaa1ef0662761d03f6ac03db2ce755
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRelease yangtools 38/65938/1
jenkins-releng [Sat, 25 Nov 2017 01:09:04 +0000 (01:09 +0000)]
Release yangtools

Change-Id: I154e2a2bec3171736675e3ac8d574184ce441d2b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent to 3.0.1 92/65892/1
Robert Varga [Fri, 24 Nov 2017 14:14:44 +0000 (15:14 +0100)]
Bump odlparent to 3.0.1

Pull in 3.0.1, as it fixes karaf distribution build.

Change-Id: I9ef1e93987a58393ebb2d32eb71c81cb872ef265
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoClarify SchemaContext getModules() API contract 23/65823/5
Robert Varga [Wed, 22 Nov 2017 00:20:31 +0000 (01:20 +0100)]
Clarify SchemaContext getModules() API contract

This clarifies the API contract with regards to iteration ordering
and shuffles the methods around a bit. Also creates additional index
for looking up Module by its QNameModule, which is common when
dealing with NormalizedNode encoding.

Change-Id: I76a8f2f24f4a70e0cf4fab544de6d79e1b476103
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRemove deprecated methods without loggerIdentity from SpecialExecutors 05/65805/2
Michael Vorburger [Tue, 21 Nov 2017 15:54:08 +0000 (16:54 +0100)]
Remove deprecated methods without loggerIdentity from SpecialExecutors

for https://jira.opendaylight.org/browse/CONTROLLER-1793

in order to force downstream projects (controller & mdsal) to use the
new methods when they upgrade to yangtools 2.0.0.  The thing is that we
cannot fix CONTROLLER-1793 in the current controller & mdsal before
switching to yangtools 2.0.0 anyway, because SpecialExecutors didn't
have the (my) previous change adding the loggerIdentity anyway.  So we
might as well do this in one round, instead of keeping these deprecated,
then once we are on yangtools 2.0.0 switch them, and then remove them?

Change-Id: I6a401979d71696536f23e1c5d1665149600f9876
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoEliminate use of deprecated checkstyle interfaces 96/65796/1
Robert Varga [Tue, 21 Nov 2017 12:31:53 +0000 (13:31 +0100)]
Eliminate use of deprecated checkstyle interfaces

Update constructors to use their non-deprecated equivalents.

Change-Id: Ibbb72e21b74f6a9c7f0ba90af7b3ec7717d68d81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup DataTree interfaces and InMemmoryDataTreeFactory 95/65795/3
Robert Varga [Tue, 21 Nov 2017 11:49:29 +0000 (12:49 +0100)]
Cleanup DataTree interfaces and InMemmoryDataTreeFactory

TipProducingDataTree is a remnant of an API freeze, merge its behavior
into baseline DataTree, adjusting callers.

Also make sure we publish DataTreeFactory properly, so users do not
have to rely on specific implementation -- cleaning up tests in process.

Change-Id: Ic2263a084ba7b8d2c611eb14407e09a78f6d922a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent dependencies to 3.0.0 80/65580/3
Stephen Kitt [Wed, 15 Nov 2017 20:31:37 +0000 (21:31 +0100)]
Bump odlparent dependencies to 3.0.0

Change-Id: I6efb03faf8913c5f4ad21fa7783ce8b6342447af
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoFix FindBugs violations and enable enforcement in utils 37/65137/5
Michael Vorburger [Sat, 4 Nov 2017 03:31:25 +0000 (04:31 +0100)]
Fix FindBugs violations and enable enforcement in utils

Change-Id: I35eff969e51d6ec9b4f4b79b1b8cb2af9b9a8150
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRename ChoiceCaseNode to CaseSchemaNode 47/65747/2
Robert Varga [Mon, 20 Nov 2017 16:34:07 +0000 (17:34 +0100)]
Rename ChoiceCaseNode to CaseSchemaNode

ChoiceCaseNode is a long-standing misnomer, causing API inconsistency
in yang-model-api. Rename it to CaseSchemaNode, just as all the other
SchemaNodes.

Change-Id: I4f2fa74a69a75ab9b7cd40d27ad756285486a791
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix a few warnings 36/65736/2
Robert Varga [Mon, 20 Nov 2017 16:20:22 +0000 (17:20 +0100)]
Fix a few warnings

- potentially static method
- unneeded else statement
- raw RangeConstraint reference

Change-Id: Ic0fb58556f95970bbd06f3716965f97b0ea41e9a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-813: add parent schemapath to error report 16/65716/3
Robert Varga [Mon, 20 Nov 2017 13:13:31 +0000 (14:13 +0100)]
YANGTOOLS-813: add parent schemapath to error report

It is not immediately clear in what context the search is being
made -- make sure we report parent path, too.

Change-Id: I86a15b409c6241d93f24ee75cc68ff78fc067ebc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMake EffectiveStatements with @Beta 19/65719/1
Robert Varga [Mon, 20 Nov 2017 13:31:20 +0000 (14:31 +0100)]
Make EffectiveStatements with @Beta

Newly-introduced EffectiveStatement interfaces are not finalized,
hence mark them with @Beta.

Change-Id: I0bdec482d50d71f367202baef466113e9a0f99bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-812: Add SchemaContextFactory control of deviations 13/64413/22
Peter Kajsa [Tue, 17 Oct 2017 16:52:05 +0000 (18:52 +0200)]
YANGTOOLS-812: Add SchemaContextFactory control of deviations

This patch adds missing API and implementation for setting supported
deviations in SchemaContextFactory.

In order to avoid passing of numerous arguments into
createSchemaContext(..) method a concept of a
SchemaContextFactoryConfiguration has been introduced in this patch,
which encapsulates all options possible to set.

Change-Id: I8eef54d729b7bfed4cee41ee6758d969fc375dcf
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoXPath evalution should identify result type 14/65714/1
Robert Varga [Mon, 20 Nov 2017 12:00:00 +0000 (13:00 +0100)]
XPath evalution should identify result type

When we select a set of NormalizedNodes, we need to also report
their path, so they can be correctly correlated to schema. Fix
XPathNodesetResult to include this information.

Change-Id: I704cf5512caecb7e90c6130ef6a7809ff92d0fc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAuto-generate yang-data-jaxen services 02/65702/1
Robert Varga [Mon, 20 Nov 2017 09:06:24 +0000 (10:06 +0100)]
Auto-generate yang-data-jaxen services

Instead of including a static resource, generate it at compile
time.

Change-Id: I079e443668e679f5580d7954161118a99e2032d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoPopulate yang-parser-api 12/65312/17
Robert Varga [Wed, 8 Nov 2017 13:36:20 +0000 (14:36 +0100)]
Populate yang-parser-api

This adds a simpistic API to access a pre-configured YANG inference engine,
so its complexities are hidden from users. Both a ServiceLoader and OSGi
loading interface is provided.

Change-Id: Iab444bd1698273c30ac37b8d3ea577ae35db71e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd bundle packaging for yang-data-transform 00/65600/2
Stephen Kitt [Thu, 16 Nov 2017 11:14:02 +0000 (12:14 +0100)]
Add bundle packaging for yang-data-transform

This allows the module to build an OSGi bundle instead of a plain
JAR.

Change-Id: I2713fdf0aefcccf589984a7271591f4cb95d1d30
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoUse version ranges for odlparent dependencies 32/64532/6
Stephen Kitt [Thu, 19 Oct 2017 16:52:14 +0000 (18:52 +0200)]
Use version ranges for odlparent dependencies

This allows odlparent version bumps to proceed without requiring
synchronised bumps in integration/distribution.

Change-Id: I123bd83bbd4ed43416bdc1958b111b8964d73dbb
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoTurn StatementSupports into singletons 82/65582/2
Robert Varga [Wed, 15 Nov 2017 22:37:33 +0000 (23:37 +0100)]
Turn StatementSupports into singletons

Since we are exposing these for potential reuse, we need to take
into account the possbility these being needed more than once.

Add getInstance() to share instances.

Change-Id: I9765c521ca7b92915b53da2b3e4ab4e15b445c1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDocument namespace behaviours using singletons 38/65538/4
Robert Varga [Wed, 15 Nov 2017 10:22:48 +0000 (11:22 +0100)]
Document namespace behaviours using singletons

This patch creates constants named BEHAVIOUR to hold the behaviour
for each namespace. This prevents confusion in defining the reactor
and also allows for instance reuse.

Change-Id: Ia03cbd3f8f6aac664895356d9aea89d54e2eb391
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd support for RFC6536 extensions 41/65141/11
Robert Varga [Fri, 3 Nov 2017 22:05:10 +0000 (23:05 +0100)]
Add support for RFC6536 extensions

This patch adds support for parsing RFC6536 extensions and related
concepts for end users.

Change-Id: I41ae3192b74660be409c63bbec82a1a14c7de4af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump odlparent to 3.0.0-SNAPSHOT and fix breakages 49/64449/30
Robert Varga [Wed, 18 Oct 2017 12:30:36 +0000 (14:30 +0200)]
Bump odlparent to 3.0.0-SNAPSHOT and fix breakages

This patch bumps the odlparent version, bringing in changes
in that release. This break checkstyle-logging, which is fixed
here.

Change-Id: Iee8fae0c70c83add3f4e7bade75eb86bf8f4d4bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoYANGTOOLS-833: redefine features 96/65496/10
Robert Varga [Tue, 14 Nov 2017 01:07:56 +0000 (02:07 +0100)]
YANGTOOLS-833: redefine features

Define both stable/experimental repositories and reorganize
features to have proper scope. Let's not split codecs as
we want to encourage cross-codec support.

Change-Id: I314cbc402af8ccfa35d60cbf9e76afe5f66edd47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-833: Eliminate unneeded dependencies 95/65495/5
Robert Varga [Tue, 14 Nov 2017 00:36:45 +0000 (01:36 +0100)]
YANGTOOLS-833: Eliminate unneeded dependencies

Trim down dependencies to their bare minimum. This is needed
to properly define our features.

Change-Id: Ie97992c4415509206e72556d49a446e48f5d5028
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-706: move odlext parser support 62/65462/13
Robert Varga [Sun, 12 Nov 2017 20:18:12 +0000 (21:18 +0100)]
YANGTOOLS-706: move odlext parser support

Use composition with a delegator pattern to implement
YangModeledAnyxmlEffectiveStatementImpl. Also adjust the pattern
used to bring in extensions. This forces them to be be aware
of yang-parser-rfc7950, which is fine, as that is the reactor
they can generally expect to be configured.

Change-Id: I91aa95221efb76753d9ea82dc164c1fffc6755c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd support for overriding statement supports 79/65479/7
Robert Varga [Mon, 13 Nov 2017 11:51:48 +0000 (12:51 +0100)]
Add support for overriding statement supports

If an extension needs to build a different implementation of a statement,
it needs to be able to override previous definition. Alternative is to
force users to special-case support when building a reactor, which is not
really feasible.

Add overrideSupport(), which performs a replacement operation, but requires
properly-targeted bundle.

Change-Id: Id9b527c115c7a6b815227f8dc796473803bf8a80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-706: separate out RFC8040 extension support 60/65460/13
Robert Varga [Sun, 12 Nov 2017 18:57:58 +0000 (19:57 +0100)]
YANGTOOLS-706: separate out RFC8040 extension support

yang-data support should live in its own artifact, now that it can
(with proper UT), move it out of yang-parser-impl.

Also refactor the way extensions are exposed to be consistent with
yang-parser-rfc7950: each extension needs to expose StatementSupports
and NamespaceBehaviours.

Change-Id: Ia691bd9ab4dd78c076ac7874fc91d9e597a8d2cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix checkstyle issues reported by odlparent-3.0.0's checkstyle 90/65490/1
Robert Varga [Mon, 13 Nov 2017 16:08:58 +0000 (17:08 +0100)]
Fix checkstyle issues reported by odlparent-3.0.0's checkstyle

This is a preparatory patch, cleaning up violations which will be
enforced by odlparent-3.0.0.

Change-Id: I0ea6b387c9d3095ff01c8e00d10c6d9d0c29aec9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBGPCEP-717: Reduce log levels 68/65468/4
Claudio D. Gasparini [Mon, 13 Nov 2017 07:22:50 +0000 (08:22 +0100)]
BGPCEP-717: Reduce log levels

Investigation udner bgp shows that
SubstatementContext is creating 1 GB spam under
tests outputs.

Change-Id: I3fe1f93db57841fca733561ed1efc3b8b4061827
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
6 years agoCorrect YangData{SchemaNode,EffectiveStatement} interfaces 59/65459/6
Robert Varga [Sun, 12 Nov 2017 18:07:00 +0000 (19:07 +0100)]
Correct YangData{SchemaNode,EffectiveStatement} interfaces

These remain tightly bound, but YangDataEffectiveStatement provides
its proper argument in its parlance.

Change-Id: I7862cb6e594f661edea39ced468f680a869bc437
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-829: Wire extension support into default reactor 57/65457/8
Robert Varga [Sun, 12 Nov 2017 14:18:10 +0000 (15:18 +0100)]
YANGTOOLS-829: Wire extension support into default reactor

Since we have reorganized, we can now safely pull in extension
supports into DefaultReactors without causing dependency cycles.

Change-Id: I6214ec374ba2320aa7fe20c436749a3df4732a57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-706: Split out yang-parser-rfc7950 56/65456/11
Robert Varga [Sun, 12 Nov 2017 03:26:44 +0000 (04:26 +0100)]
YANGTOOLS-706: Split out yang-parser-rfc7950

With the internal reorganized, we can now safely split off core
rfc7950 parser and turn yang-parser-impl into a wiring artifact,
which pulls in all the bits and pieces and exposes a user-friendly
interface.

Change-Id: Iea3b8f2d76e37c6e0d37620356f7b824f3cfb249
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdjust test suite parser update to conform with API changes 53/65453/8
Robert Varga [Sun, 12 Nov 2017 03:08:07 +0000 (04:08 +0100)]
Adjust test suite parser update to conform with API changes

This is the next step to parser split-up: make sure the unit test
suite refers to the minimum parser it needs to perform its function.

Change-Id: I8ddb143706debfe9f2ac2fc665ec982c1c4e3039
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRefactor RFC7950Reactors 52/65452/9
Robert Varga [Sun, 12 Nov 2017 00:34:10 +0000 (01:34 +0100)]
Refactor RFC7950Reactors

This patch corrects {Default,RFC7950}Reactors behavior, eliminating
YangInferencePipeline in the process.

Change-Id: Ica2ecac0baa5bdacb7456aa733b13230cb9c54c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove CustomStatementParserBuilder and YangInferencePipeline 51/65451/10
Robert Varga [Sat, 11 Nov 2017 23:29:19 +0000 (00:29 +0100)]
Move CustomStatementParserBuilder and YangInferencePipeline

Both these classes relate to reactor integration. Move them to
parser.rfc7950.reactor for further evolution. Furthermore
YangValidationBundles can be moved to reactor utilities.

This eliminates parser.stmt.rfc6020 package, paving the way
for splitting out parser.rfc7950.* into a separate artifact.

Change-Id: I44d10f49368d252dd0dfd02b03b3413b53f3331b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove yang.parser.stmt.rfc6020.Utils 50/65450/9
Robert Varga [Sat, 11 Nov 2017 23:25:44 +0000 (00:25 +0100)]
Move yang.parser.stmt.rfc6020.Utils

The only user of the leftover methods is rfc7950.repo. Rename this
class and move it into rfc7950 and hide it.

Change-Id: I5a67e1467fb0c15f18c78d543c520eafcd1cd01c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoYANGTOOLS-829: add parser support for openconfig-hashed-value 49/65449/9
Robert Varga [Sat, 11 Nov 2017 22:27:22 +0000 (23:27 +0100)]
YANGTOOLS-829: add parser support for openconfig-hashed-value

This patch adds metamodel and parsing support for openconfig-hashed-value
and its predecessor, openconfig-encrypted-value.

Change-Id: Iac44d2e34a9b4ccc931ddb69e3d6709b962e7378
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove Utils.findNode() 48/65448/7
Robert Varga [Sat, 11 Nov 2017 21:10:53 +0000 (22:10 +0100)]
Move Utils.findNode()

This is a plain lookup on SchemaNodeIdentifierBuildNamespace, move
the method there so it can easily be maintained.

Adjust call sites to it returning Optional. One call site relies
on result being StatementContextBase -- rather than polluting the
lookup method, guard the site.

Change-Id: I0553710a79e5ca987d35d9fbedd13c164e78f244
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSplit out OpenConfig extension metamodel 47/65447/7
Robert Varga [Sat, 11 Nov 2017 15:53:31 +0000 (16:53 +0100)]
Split out OpenConfig extension metamodel

While the effects of the semantic version extensions are deeply
integrated into how YANG parser operates, the metamodel defined
by the extension itself does not need to be hard-wired.

Move the model bits out into a separate component, eliminating
the need for SupportedExtensionsMapping.

Change-Id: I497347ce79a2c07fdc462e83a20babb941c5cb1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSplit out OpenDaylight yang-ext metamodel 46/65446/9
Robert Varga [Sat, 11 Nov 2017 15:36:33 +0000 (16:36 +0100)]
Split out OpenDaylight yang-ext metamodel

AnyxmlSchemaLocation is an unpublished extensions, which should
not be part of yang-model-api. Split it out into a separate metamodel
extension.

Also clean up parser support, which unfortunately needs to be integrated
due to how the SchemaNode instance is overridden.

Change-Id: Ied1688b82505cd34bfe3151f8686d697f81787ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoRename yang.parser.rfc6020.repo to yang.parser.rfc7950.repo 45/65445/8
Robert Varga [Sat, 11 Nov 2017 14:49:46 +0000 (15:49 +0100)]
Rename yang.parser.rfc6020.repo to yang.parser.rfc7950.repo

Move this package to have a consistent structure of the RFC7950
parser along with its supports.

Change-Id: I2e93285a11451ccd79bedb33dca51bf55e453e89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove ASTSchemaSource and its components into rfc6020.repo 44/65444/8
Robert Varga [Sat, 11 Nov 2017 14:37:27 +0000 (15:37 +0100)]
Move ASTSchemaSource and its components into rfc6020.repo

ASTSchemaSource, TextToASTTransformer and YangModuleDependencyInfo
are inter-related and depend in YANG text format. Move them to
rfc6020.repo and hide their constructors as appropriate.

Change-Id: I11a8d3b29328a1f2574205d7a8b8ccd192637db4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove YangStatementParserListenerImpl 43/65443/7
Robert Varga [Sat, 11 Nov 2017 14:06:58 +0000 (15:06 +0100)]
Move YangStatementParserListenerImpl

This is a detail of how YangStatementStreamSource operates and hence
should be part of the same package. Move it to rfc6020.repo and hide
it from the world.

Change-Id: Idc43720c83685b425eb058cf4f6ebcfbbeb38ef5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge PathUtils, TypeUtils and Utils methods 42/65442/7
Robert Varga [Sat, 11 Nov 2017 13:57:53 +0000 (14:57 +0100)]
Merge PathUtils, TypeUtils and Utils methods

All of PathUtils and TypeUtils methods and some of Utils methods
are centered around dealing with statement arguments. Concentrate
all of them into a single utility class, rfc7950.stmt.ArgumentUtils.

This eliminates TypeUtils completely and leaves Utils with only
two methods, which are not used in statement reactor at all.

Change-Id: I816563e362a6294eed3df655be09d3d1d6173a04
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove default value checks from TypeUtils to EffectiveStmtUtils 41/65441/7
Robert Varga [Sat, 11 Nov 2017 13:48:27 +0000 (14:48 +0100)]
Move default value checks from TypeUtils to EffectiveStmtUtils

These methods are used by effective statement implementations, hence
EffectiveStmtUtils is the best place to host them for now.

Change-Id: I5151fec7959ef2243ef5094f332ca807f10ff42b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCreate parser.rfc7950.namespace package and populate it 40/65440/7
Robert Varga [Sat, 11 Nov 2017 13:30:38 +0000 (14:30 +0100)]
Create parser.rfc7950.namespace package and populate it

This package contains namespaces populated and used by the parser
implementation.

Change-Id: I0fce253217397356a28e1cc15a8dff2c8c476852
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoSplit out TypeUtils.parse{Length,Range}ListFromString 39/65439/4
Robert Varga [Sat, 11 Nov 2017 13:13:53 +0000 (14:13 +0100)]
Split out TypeUtils.parse{Length,Range}ListFromString

Each of these has a natural place in the respective type's
StatementSupport. Move them out, leaving common items in
TypeUtils for now.

Change-Id: Id879ab588170ec90a74196f8d0d16f37b54f85c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMove TypeUtils.typeEffectiveSchemaPath() 38/65438/4
Robert Varga [Sat, 11 Nov 2017 13:07:15 +0000 (14:07 +0100)]
Move TypeUtils.typeEffectiveSchemaPath()

Only users of this method reside in rfc7950.stmt.type package,
move it to AbstractTypeStatementSupport and hide it.

Change-Id: I867bb4c19456002ec1034d7a21c5d9a2aa0dd4c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>