2 * Copyright (c) 2022 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 java.util.List;
11 import org.opendaylight.mdsal.binding.generator.impl.reactor.CollisionDomain.Member;
12 import org.opendaylight.mdsal.binding.generator.impl.rt.DefaultInputRuntimeType;
13 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
14 import org.opendaylight.mdsal.binding.runtime.api.InputRuntimeType;
15 import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
16 import org.opendaylight.yangtools.binding.lib.contract.StatementNamespace;
17 import org.opendaylight.yangtools.binding.model.api.GeneratedType;
18 import org.opendaylight.yangtools.binding.model.ri.BindingTypes;
19 import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
22 * Generator corresponding to an {@code input} statement. We use a combination of the operation name and "Input"
23 * as the name. This makes it easier to support multiple RPCs/actions in one source file, as we can import them without
26 final class InputGenerator extends OperationContainerGenerator<InputEffectiveStatement, InputRuntimeType> {
27 InputGenerator(final InputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
28 super(statement, parent, BindingTypes.RPC_INPUT);
32 StatementNamespace namespace() {
33 return StatementNamespace.INPUT;
37 Member createMember(final CollisionDomain domain, final Member parent) {
38 return domain.addSecondary(this, parent);
42 CompositeRuntimeTypeBuilder<InputEffectiveStatement, InputRuntimeType> createBuilder(
43 final InputEffectiveStatement statement) {
44 return new CompositeRuntimeTypeBuilder<>(statement) {
46 InputRuntimeType build(final GeneratedType type, final InputEffectiveStatement statement,
47 final List<RuntimeType> children, final List<AugmentRuntimeType> augments) {
48 return new DefaultInputRuntimeType(type, statement, children, augments);