Remove AbstractExplicitGenerator.recursiveRuntimeType()
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / AbstractImplicitGenerator.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.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.mdsal.binding.generator.impl.reactor.CollisionDomain.Member;
12 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
13
14 /**
15  * An implicit {@link Generator}, not associated with any particular statement. We use these only for aggregate services
16  * harking back to the original specification for Java 7. As such we want to eventually get rid of it.
17  */
18 // FIXME: eventually remove this subclass and unify Generator and AbstractExplicitGenerator
19 abstract class AbstractImplicitGenerator extends Generator {
20     AbstractImplicitGenerator(final ModuleGenerator parent) {
21         super(parent);
22     }
23
24     @Override
25     final void pushToInference(final SchemaInferenceStack inferenceStack) {
26         // No-op
27     }
28
29     @Override
30     final ClassPlacement classPlacement() {
31         return ClassPlacement.TOP_LEVEL;
32     }
33
34     @Override
35     final Member createMember(final CollisionDomain domain) {
36         return domain.addSecondary(this, ((ModuleGenerator) getParent()).getPrefixMember(), classSuffix());
37     }
38
39     abstract @NonNull String classSuffix();
40 }