2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2024 Ericsson
4 * Modifications Copyright (C) 2024 OpenInfra Foundation Europe
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
21 package org.oran.smo.yangtools.parser.yanglibrary;
23 import org.oran.smo.yangtools.parser.ParserExecutionContext;
24 import org.oran.smo.yangtools.parser.data.dom.YangDataDomNode;
27 * Implementations of this interface will extract Yang Library-related data from data DOM nodes and
28 * populate various objects relating to yang library, eg. modules. Implementations are expected to
29 * not throw exceptions, but to add findings to the supplied context if errors are encountered.
31 * Clients will typically implement this interface if the Yang Library contains data in addition to
32 * what is defined in RFC 8525; for example, vendor-proprietary data relating to modules.
34 * A default implementation is provided in {@link RFC8525Populator} which handles all the data nodes
35 * as defined in RFC 8525.
37 * @author Mark Hollmann
39 public interface YangLibraryPopulator {
42 * Callback for population of the ModulesState object.
44 default void populateModulesState(final ParserExecutionContext context, final ModulesState modulesState,
45 final YangDataDomNode modulesStateDomNode) {
49 * Callback for populating the Module object, from modules-state branch.
51 default void populateModuleInModulesState(final ParserExecutionContext context, final Module module,
52 final YangDataDomNode moduleDomNode) {
56 * Callback for populating the Submodule object, from modules-state branch.
58 default void populateSubmoduleInModulesState(final ParserExecutionContext context, final Submodule submodule,
59 final YangDataDomNode submoduleDomNode) {
63 * Callback for population of the YangLibrary object.
65 default void populateYangLibrary(final ParserExecutionContext context, final YangLibrary yangLibrary,
66 final YangDataDomNode yangLibraryDomNode) {
70 * Callback for population of the ModuleSet object.
72 default void populateModuleSet(final ParserExecutionContext context, final ModuleSet moduleSet,
73 final YangDataDomNode moduleSetDomNode) {
77 * Callback for populating the Module object, from yang-library branch.
79 default void populateModuleInYangLibrary(final ParserExecutionContext context, final Module module,
80 final YangDataDomNode moduleDomNode, final String conformanceType) {
84 * Callback for populating the Submodule object, from yang-library branch.
86 default void populateSubmoduleInYangLibrary(final ParserExecutionContext context, final Submodule submodule,
87 final YangDataDomNode submoduleDomNode) {