2 * Copyright (c) 2021 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 org.opendaylight.mdsal.binding.generator.impl.rt.DefaultLeafRuntimeType;
11 import org.opendaylight.mdsal.binding.runtime.api.LeafRuntimeType;
12 import org.opendaylight.yangtools.binding.lib.contract.StatementNamespace;
13 import org.opendaylight.yangtools.binding.model.api.Type;
14 import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement;
17 * Generator corresponding to a {@code leaf} statement.
19 final class LeafGenerator extends AbstractTypeAwareGenerator<LeafEffectiveStatement, LeafRuntimeType, LeafGenerator> {
20 LeafGenerator(final LeafEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
21 super(statement, parent);
25 StatementNamespace namespace() {
26 return StatementNamespace.LEAF;
30 LeafRuntimeType createExternalRuntimeType(final Type type) {
31 return new DefaultLeafRuntimeType(type, statement());
35 LeafRuntimeType createInternalRuntimeType(final AugmentResolver resolver, final LeafEffectiveStatement statement,
37 return new DefaultLeafRuntimeType(type, statement);