From: Robert Varga Date: Fri, 12 Jun 2020 06:32:05 +0000 (+0200) Subject: Add CrossSourceStatementReactor javadocs X-Git-Tag: v5.0.4~77 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=c13ff32821b7624d2a45ab083a9b7b5ab53db3b8;p=yangtools.git Add CrossSourceStatementReactor javadocs Clarify interface contracts based on current behavior. Also add a single-argument addLibSource(). JIRA: YANGTOOLS-652 Change-Id: I02829a2cb40ff03f38cc5136a16d76a4f4b27dd0 Signed-off-by: Robert Varga --- diff --git a/yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/CrossSourceStatementReactor.java b/yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/CrossSourceStatementReactor.java index dca20a74aa..a913ffd86b 100644 --- a/yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/CrossSourceStatementReactor.java +++ b/yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/CrossSourceStatementReactor.java @@ -103,9 +103,9 @@ public final class CrossSourceStatementReactor { /** * Add main source. All main sources are present in resulting SchemaContext. * - * @param source - * which should be added into main sources + * @param source which should be added into main sources * @return This build action, for fluent use. + * @throws NullPointerException if @{code source} is null */ public @NonNull BuildAction addSource(final StatementStreamSource source) { context.addSource(source); @@ -115,15 +115,22 @@ public final class CrossSourceStatementReactor { /** * Add main sources. All main sources are present in resulting SchemaContext. * - * @param sources - * which should be added into main sources + * @param sources which should be added into main sources * @return This build action, for fluent use. + * @throws NullPointerException if @{code sources} is null or contains a null element */ public @NonNull BuildAction addSources(final StatementStreamSource... sources) { addSources(Arrays.asList(sources)); return this; } + /** + * Add main sources. All main sources are present in resulting SchemaContext. + * + * @param sources which should be added into main sources + * @return This build action, for fluent use. + * @throws NullPointerException if @{code sources} is null or contains a null element + */ public @NonNull BuildAction addSources(final @NonNull Collection sources) { for (final StatementStreamSource source : sources) { context.addSource(requireNonNull(source)); @@ -131,6 +138,22 @@ public final class CrossSourceStatementReactor { return this; } + /** + * Add a library source. Only library sources required by main sources are present in resulting SchemaContext. + * Any other library sources are ignored and this also applies to error reporting. + * + *

+ * Library sources are not supported in semantic version mode currently. + * + * @param libSource source which should be added into library sources + * @return This build action, for fluent use. + * @throws NullPointerException if @{code libSource} is null + */ + public @NonNull BuildAction addLibSource(final StatementStreamSource libSource) { + context.addLibSource(libSource); + return this; + } + /** * Add library sources. Only library sources required by main sources are present in resulting SchemaContext. * Any other library sources are ignored and this also applies to error reporting. @@ -138,14 +161,26 @@ public final class CrossSourceStatementReactor { *

* Library sources are not supported in semantic version mode currently. * - * @param libSources yang sources which should be added into library sources + * @param libSources sources which should be added into library sources * @return This build action, for fluent use. + * @throws NullPointerException if @{code libSources} is null or contains a null element */ public @NonNull BuildAction addLibSources(final StatementStreamSource... libSources) { addLibSources(Arrays.asList(libSources)); return this; } + /** + * Add library sources. Only library sources required by main sources are present in resulting SchemaContext. + * Any other library sources are ignored and this also applies to error reporting. + * + *

+ * Library sources are not supported in semantic version mode currently. + * + * @param libSources sources which should be added into library sources + * @return This build action, for fluent use. + * @throws NullPointerException if @{code libSources} is null or contains a null element + */ public @NonNull BuildAction addLibSources(final Collection libSources) { for (final StatementStreamSource libSource : libSources) { context.addLibSource(libSource);