Change action input/output naming strategy
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / InputGenerator.java
index 08e4da9b3ad8b6cbeeeb63c6cbe7f90ecafa2beb..10a356496455db595ed1d455a48fe30f34a7bd06 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.mdsal.binding.generator.impl.reactor;
 
 import java.util.List;
+import org.opendaylight.mdsal.binding.generator.impl.reactor.CollisionDomain.Member;
 import org.opendaylight.mdsal.binding.generator.impl.rt.DefaultInputRuntimeType;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
 import org.opendaylight.mdsal.binding.model.ri.BindingTypes;
@@ -17,15 +18,23 @@ import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
 import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
 
 /**
- * Generator corresponding to an {@code input} statement.
+ * Generator corresponding to an {@code input} statement. We use a combination of the operation name and "Input"
+ * as the name. This makes it easier to support multiple RPCs/actions in one source file, as we can import them without
+ * a conflict.
  */
-class InputGenerator extends OperationContainerGenerator<InputEffectiveStatement, InputRuntimeType> {
+// FIXME: hide this once we have RpcRuntimeType
+public final class InputGenerator extends OperationContainerGenerator<InputEffectiveStatement, InputRuntimeType> {
     InputGenerator(final InputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
         super(statement, parent, BindingTypes.RPC_INPUT);
     }
 
     @Override
-    final CompositeRuntimeTypeBuilder<InputEffectiveStatement, InputRuntimeType> createBuilder(
+    Member createMember(final CollisionDomain domain, final Member parent) {
+        return domain.addSecondary(this, parent);
+    }
+
+    @Override
+    CompositeRuntimeTypeBuilder<InputEffectiveStatement, InputRuntimeType> createBuilder(
             final InputEffectiveStatement statement) {
         return new CompositeRuntimeTypeBuilder<>(statement) {
             @Override