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.model.api.GeneratedType;
14 import org.opendaylight.mdsal.binding.model.ri.BindingTypes;
15 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
16 import org.opendaylight.mdsal.binding.runtime.api.InputRuntimeType;
17 import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
18 import org.opendaylight.yangtools.yang.binding.contract.StatementNamespace;
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 // FIXME: hide this once we have RpcRuntimeType
27 public final class InputGenerator extends OperationContainerGenerator<InputEffectiveStatement, InputRuntimeType> {
28 InputGenerator(final InputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
29 super(statement, parent, BindingTypes.RPC_INPUT);
33 StatementNamespace namespace() {
34 return StatementNamespace.INPUT;
38 Member createMember(final CollisionDomain domain, final Member parent) {
39 return domain.addSecondary(this, parent);
43 CompositeRuntimeTypeBuilder<InputEffectiveStatement, InputRuntimeType> createBuilder(
44 final InputEffectiveStatement statement) {
45 return new CompositeRuntimeTypeBuilder<>(statement) {
47 InputRuntimeType build(final GeneratedType type, final InputEffectiveStatement statement,
48 final List<RuntimeType> children, final List<AugmentRuntimeType> augments) {
49 return new DefaultInputRuntimeType(type, statement, children, augments);