Bump to odlparent-9.0.0/yangtools-7.0.1-SNAPSHOT
[mdsal.git] / binding / mdsal-binding-generator-impl / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / ModuleAugmentGenerator.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.generator.impl.reactor;
9
10 import org.opendaylight.yangtools.yang.model.api.stmt.AugmentEffectiveStatement;
11
12 /**
13  * Generator corresponding to a {@code augment} statement used as a child of a {@code module} statement.
14  */
15 final class ModuleAugmentGenerator extends AbstractAugmentGenerator {
16     ModuleAugmentGenerator(final AugmentEffectiveStatement statement, final AbstractCompositeGenerator<?> parent) {
17         super(statement, parent);
18     }
19
20     @Override
21     void loadTargetGenerator() {
22         throw new UnsupportedOperationException();
23     }
24
25     void linkAugmentationTarget(final GeneratorContext context) {
26         // FIXME: we need two-step resolution here:
27
28 //      if (targetSchemaNode instanceof DataSchemaNode && ((DataSchemaNode) targetSchemaNode).isAddedByUses()) {
29 //          if (targetSchemaNode instanceof DerivableSchemaNode) {
30 //              targetSchemaNode = ((DerivableSchemaNode) targetSchemaNode).getOriginal().orElse(null);
31 //          }
32 //          if (targetSchemaNode == null) {
33 //              throw new IllegalStateException("Failed to find target node from grouping in augmentation " + augSchema
34 //                  + " in module " + context.module().getName());
35 //          }
36 //      }
37
38         setTargetGenerator(context.resolveSchemaNode(statement().argument()));
39     }
40 }