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 static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import org.eclipse.jdt.annotation.NonNull;
16 * <a href="https://tools.ietf.org/html/rfc6020#section-6.2.1">YANG statement namespaces</a> which we process.
18 // FIXME: move this to 'BindingNamespace' in binding-spec-util
19 enum StatementNamespace {
21 * The namespace of all {@code identity} statements, bullet 4.
25 * The namespace of all {@code typedef} statements, bullet 5.
29 * The namespace of all {@code grouping} statements, bullet 6.
33 * All other processed statements. Includes {@code augment}, and {@code schema tree} statements.
35 // FIXME: peel augment into "$A", which our own thing
36 // FIXME: add "$D" to disambiguate <module-name>Data
37 // FIXME: add "$L" to disambiguate <module-name>Listener
38 // FIXME: add "$S" to disambiguate <module-name>Service
41 private final @NonNull String suffix;
43 StatementNamespace(final @NonNull String suffix) {
44 this.suffix = requireNonNull(suffix);
47 @NonNull String appendSuffix(final String str) {
48 return suffix.isEmpty() ? verifyNotNull(str) : str + suffix;