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.tree;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.mdsal.binding.generator.impl.reactor.AbstractExplicitGenerator;
12 import org.opendaylight.yangtools.concepts.Identifiable;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
17 * An object reflecting a YANG {@code schema node}.
19 * @param <S> Concrete {@link SchemaTreeEffectiveStatement} type
20 * @param <G> Concrete {@link AbstractExplicitGenerator} type
22 // FIXME: do not reference Generator once we have the codegen and runtime views well-defined
23 public interface SchemaTreeChild<S extends SchemaTreeEffectiveStatement<?>,
24 G extends AbstractExplicitGenerator<S> & SchemaTreeChild<S, G>> extends Identifiable<QName> {
26 default QName getIdentifier() {
27 return statement().argument();
31 * Return the effective YANG statement being represented by this object.
33 * @return A YANG statement
35 @NonNull S statement();
38 * Return the generator responsible for handling the binding type view of this statement. Note that the statement
39 * returned by {@code generator().statement()} may differ from the statement returned by {@link #statement()}.
41 * @return Underlying binding generator
42 * @throws IllegalStateException if the generator has not been resolved yet
44 @NonNull G generator();