import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stax.StAXSource;
import org.opendaylight.yangtools.rfc7952.model.api.AnnotationSchemaNode;
-import org.opendaylight.yangtools.rfc8528.data.api.YangLibraryConstants;
import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaNode;
import org.opendaylight.yangtools.rfc8528.model.api.SchemaMountConstants;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.common.XMLNamespace;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.MountPointContext;
import org.opendaylight.yangtools.yang.data.api.schema.MountPointContextFactory.ContainerName;
private static void addMountPointChild(final MountPointData mount, final XMLNamespace namespace,
final String localName, final DOMSource source) {
final DOMSourceMountPointChild child = new DOMSourceMountPointChild(source);
- if (YangLibraryConstants.MODULE_NAMESPACE.equals(namespace)) {
+ if (YangConstants.YANG_LIBRARY_NAMESPACE.equals(namespace)) {
final var optName = ContainerName.forLocalName(localName);
if (optName != null) {
mount.setContainer(optName, child);
* <a href="https://datatracker.ietf.org/doc/html/rfc6020#section-13.1">RFC6020, section 13.1</a>.
*/
public static final QName NON_UNIQUE_QNAME = QName.create(RFC6020_YANG_MODULE, "non-unique").intern();
+ /**
+ * The module name assigned to {@code ietf-yang-library}. This constant is required for JSON-like parsers, using
+ * module names to reference modules.
+ */
+ public static final String YANG_LIBRARY_MODULE_NAME = "ietf-yang-library";
+ /**
+ * The namespace assigned to {@code ietf-yang-library}. This constant is required for XML-like parsers, using
+ * XML namespaces to reference modules.
+ */
+ public static final String YANG_LIBRARY_NAMESPACE_STRING = "urn:ietf:params:xml:ns:yang:ietf-yang-library";
+ /**
+ * The namespace assigned to {@code ietf-yang-library}. This constant is useful for referencing things in a
+ * type-safe manner.
+ */
+ public static final XMLNamespace YANG_LIBRARY_NAMESPACE = XMLNamespace.of(YANG_LIBRARY_NAMESPACE_STRING).intern();
+ /**
+ * {@code ietf-yang-library} namespace bound to YANG through
+ * <a href="https://www.rfc-editor.org/rfc/rfc7895#section-2.2">ietf-yang-library@2016-06-21.yang</a>.
+ */
+ public static final QNameModule RFC7895_YANG_MODULE =
+ QNameModule.create(YANG_LIBRARY_NAMESPACE, Revision.of("2016-06-21")).intern();
+ /**
+ * {@code ietf-yang-library} namespace bound to YANG through
+ * <a href="https://datatracker.ietf.org/doc/html/rfc8525#section-4">ietf-yang-library@2019-01-04.yang</a>.
+ */
+ public static final QNameModule RFC8525_YANG_MODULE =
+ QNameModule.create(YANG_LIBRARY_NAMESPACE, Revision.of("2019-01-04")).intern();
// Dummy template UnqualifiedQName. These are never leaked, but are used for efficient instantiation via
// UnqualifiedQName#bindTo()
+++ /dev/null
-/*
- * Copyright (c) 2019 PANTHEON.tech s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.rfc8528.data.api;
-
-import com.google.common.annotations.Beta;
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.yangtools.yang.common.XMLNamespace;
-
-/**
- * Constants related to {@code ietf-yang-library.yang}. As schema-mount works in concert with yang-library, we need
- * these constants to interpret correctly categorize incoming data and present them to schema resolution process.
- *
- * <p>
- * While RFC7895 and RFC8525 are not strictly required by YANG, RFC7950 contains a weak reference to it when dealing
- * with capability negotiation on protocol layers. Moreover RFC8528 makes it explicit that an instance of yang-library
- * is mounted underneath both {@code inline} and {@code shared-schema} types of mount.
- *
- * <p>
- * While we could mandate use of either RFC7895 or RFC8525 across the board, this is not feasible, as mount points may
- * be nested and point to external systems -- hence it is completely possible to encounter both old and new information
- * in a single mount point tree.
- */
-@Beta
-@NonNullByDefault
-public final class YangLibraryConstants {
- /**
- * The namespace assigned to {@code ietf-yang-library}. This constant is required for XML-like parsers, using
- * XML namespaces to reference modules.
- */
- public static final XMLNamespace MODULE_NAMESPACE =
- XMLNamespace.of("urn:ietf:params:xml:ns:yang:ietf-yang-library");
- /**
- * The module name assigned to {@code ietf-yang-library}. This constant is required for JSON-like parsers, using
- * module names to reference modules.
- */
- public static final String MODULE_NAME = "ietf-yang-library";
-
- private YangLibraryConstants() {
- // Hidden
- }
-}