2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.generator.impl.reactor;
10 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
11 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
12 import org.opendaylight.yangtools.yang.model.api.stmt.ContainerEffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
16 * Generator corresponding to a {@code container} statement.
18 final class ContainerGenerator extends AbstractCompositeGenerator<ContainerEffectiveStatement> {
19 ContainerGenerator(final ContainerEffectiveStatement statement, final AbstractCompositeGenerator<?> parent) {
20 super(statement, parent);
24 void pushToInference(final SchemaInferenceStack dataTree) {
25 dataTree.enterDataTree(statement().getIdentifier());
29 GeneratedType createTypeImpl(final TypeBuilderFactory builderFactory) {
30 final GeneratedTypeBuilder builder = builderFactory.newGeneratedTypeBuilder(typeName());
31 addImplementsChildOf(builder);
32 addAugmentable(builder);
33 addUsesInterfaces(builder, builderFactory);
34 addConcreteInterfaceMethods(builder);
36 final ModuleGenerator module = currentModule();
37 module.addQNameConstant(builder, localName());
39 addGetterMethods(builder, builderFactory);
41 annotateDeprecatedIfNecessary(builder);
42 builderFactory.addCodegenInformation(module, statement(), builder);
43 builder.setModuleName(module.statement().argument().getLocalName());
44 // builder.setSchemaPath(node.getPath());
46 return builder.build();