java.lang.Object
org.opendaylight.yangtools.yang.parser.spi.ParserNamespaces

public final class ParserNamespaces extends Object
Baseline ParserNamespaces mostly derived from YANG specification.
  • Field Details

    • EXTENSION

      public static final @NonNull ParserNamespace<QName,StmtContext<QName,org.opendaylight.yangtools.yang.model.api.stmt.ExtensionStatement,org.opendaylight.yangtools.yang.model.api.stmt.ExtensionEffectiveStatement>> EXTENSION
      Extension namespace. All extension names defined in a module and its submodules share the same extension identifier namespace, where each extension is identified by a QName formed from the defining module's QNameModule and the identifier specified in extension statement's argument.
    • FEATURE

      public static final @NonNull ParserNamespace<QName,StmtContext<QName,org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement,org.opendaylight.yangtools.yang.model.api.stmt.FeatureEffectiveStatement>> FEATURE
      Feature namespace. All feature names defined in a module and its submodules share the same feature identifier namespace. Each feature is identified by a QName formed from the defining module's QNameModule and the feature name.
    • GROUPING

      public static final @NonNull ParserNamespace<QName,StmtContext<QName,org.opendaylight.yangtools.yang.model.api.stmt.GroupingStatement,org.opendaylight.yangtools.yang.model.api.stmt.GroupingEffectiveStatement>> GROUPING
      Grouping namespace. * All grouping names defined within a parent node or at the top level of the module or its submodules share the same grouping identifier namespace. This namespace is scoped to all descendant nodes of the parent node or module.

      This means that any descendant node may use that grouping, and it MUST NOT define a grouping with the same name.

    • IDENTITY

      public static final @NonNull ParserNamespace<QName,StmtContext<QName,org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement,org.opendaylight.yangtools.yang.model.api.stmt.IdentityEffectiveStatement>> IDENTITY
      Identity namespace. All identity names defined in a module and its submodules share the same identity identifier namespace.
    • MODULE

      public static final @NonNull ParserNamespace<org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier,StmtContext<UnresolvedQName.Unqualified,org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement,org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement>> MODULE
      Module namespace. All modules known to the reactor are populated to this namespace. Each module is identified by a SourceIdentifier.
    • SUBMODULE

      public static final @NonNull ParserNamespace<org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier,StmtContext<UnresolvedQName.Unqualified,org.opendaylight.yangtools.yang.model.api.stmt.SubmoduleStatement,org.opendaylight.yangtools.yang.model.api.stmt.SubmoduleEffectiveStatement>> SUBMODULE
      Submodule equivalent of MODULE.
    • TYPE

      public static final @NonNull ParserNamespace<QName,StmtContext<QName,org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement,org.opendaylight.yangtools.yang.model.api.stmt.TypedefEffectiveStatement>> TYPE
      Derived types namespace. All derived type names defined within a parent node or at the top level of the module (or its submodules) share the same type identifier namespace.

      This namespace is scoped to all descendant nodes of the parent node or module. This means that any descendant node may use that typedef, and it MUST NOT define a typedef with the same name.

      This namespace includes all type definitions implied by the language in which the current statement resides (e.g. RFC6020/RFC7950 for YANG 1.0/1.1).

    • NAMESPACE_TO_MODULE

      public static final @NonNull ParserNamespace<QNameModule,StmtContext<UnresolvedQName.Unqualified,org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement,org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement>> NAMESPACE_TO_MODULE
      A derived namespace allowing lookup of modules based on their QNameModule.
    • PRELINKAGE_MODULE

      public static final @NonNull ParserNamespace<UnresolvedQName.Unqualified,StmtContext<UnresolvedQName.Unqualified,org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement,org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement>> PRELINKAGE_MODULE
      Intermediate-stage namespace equivalent to MODULE except it is keyed by module names. This namespace is used to resolve inter-module references before actual linkage occurs.
    • BELONGSTO_PREFIX_TO_MODULECTX

      public static final @NonNull ParserNamespace<String,StmtContext<?,?,?>> BELONGSTO_PREFIX_TO_MODULECTX
      Source-specific mapping of belongsTo prefixes to module identifiers. This mapping allows source-specific context to correctly populate prefixes map for actual parsing phase and eventually, resolve QName for any valid declared statement.
    • BELONGSTO_PREFIX_TO_MODULE_NAME

      public static final @NonNull ParserNamespace<String,UnresolvedQName.Unqualified> BELONGSTO_PREFIX_TO_MODULE_NAME
      Source-specific mapping of prefixes to namespaces.
    • MODULE_FOR_BELONGSTO

      public static final @NonNull ParserNamespace<UnresolvedQName.Unqualified,StmtContext<UnresolvedQName.Unqualified,org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement,org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement>> MODULE_FOR_BELONGSTO
      Namespace similar to MODULE for storing modules into Yang model storage but keyed by plain name.
    • IMP_PREFIX_TO_NAMESPACE

      public static final @NonNull ParserNamespace<String,XMLNamespace> IMP_PREFIX_TO_NAMESPACE
      Pre-linkage source-specific mapping of prefixes to module namespaces.
    • IMPORT_PREFIX_TO_MODULECTX

      public static final @NonNull ParserNamespace<String,StmtContext<?,?,?>> IMPORT_PREFIX_TO_MODULECTX
      Source-specific mapping of prefix strings to module context.
    • IMPORTED_MODULE

      public static final @NonNull ParserNamespace<org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier,StmtContext<?,?,?>> IMPORTED_MODULE
    • INCLUDED_MODULE

      public static final @NonNull ParserNamespace<org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier,StmtContext<?,?,?>> INCLUDED_MODULE
    • INCLUDED_SUBMODULE_NAME_TO_MODULECTX

      public static final @NonNull ParserNamespace<UnresolvedQName.Unqualified,StmtContext<?,?,?>> INCLUDED_SUBMODULE_NAME_TO_MODULECTX
      Source-specific mapping of prefixes to namespaces.
    • MODULE_NAME_TO_QNAME

      public static final @NonNull ParserNamespace<UnresolvedQName.Unqualified,QNameModule> MODULE_NAME_TO_QNAME
      Source-specific mapping of prefixes to namespaces.
    • MODULECTX_TO_QNAME

      public static final @NonNull ParserNamespace<StmtContext<?,?,?>,QNameModule> MODULECTX_TO_QNAME
      Global mapping of modules to QNameModules.
    • SUPPORTED_FEATURES

      public static final @NonNull ParserNamespace<Empty,Set<QName>> SUPPORTED_FEATURES
    • PREFIX_TO_MODULE

      public static final @NonNull ParserNamespace<String,QNameModule> PREFIX_TO_MODULE
      Source-specific mapping of prefixes to namespaces. This namespace is populated by all statements which have impact on the XML namespace, for example import, belongs-to and really anywhere a prefix statement is present.
      See Also:
    • MODULES_DEVIATED_BY

      public static final @NonNull ParserNamespace<Empty,com.google.common.collect.SetMultimap<QNameModule,QNameModule>> MODULES_DEVIATED_BY
      Namespace used for storing information about modules that support deviation resolution. Map key (QNameModule) denotes a module which can be deviated by the modules specified in the Map value.
    • MODULE_NAMESPACE_TO_NAME

      public static final @NonNull ParserNamespace<QNameModule,UnresolvedQName.Unqualified> MODULE_NAMESPACE_TO_NAME
      Source-specific mapping of prefixes to namespaces.
    • MODULE_NAME_TO_NAMESPACE

      public static final @NonNull ParserNamespace<UnresolvedQName.Unqualified,XMLNamespace> MODULE_NAME_TO_NAMESPACE
      Pre-linkage global mapping of module names to namespaces.
    • MODULECTX_TO_SOURCE

      public static final @NonNull ParserNamespace<StmtContext<?,?,?>,org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier> MODULECTX_TO_SOURCE
      Global mapping of modules to source identifier.
  • Method Details

    • schemaTree

      public static <D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<QName>, E extends org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement<D>> @NonNull ParserNamespace<QName,StmtContext<QName,D,E>> schemaTree()
      Statement local namespace, which holds direct schema node descendants. This corresponds to the contents of the schema tree as exposed through SchemaTreeAwareEffectiveStatement.

      Unlike all other namespaces this namespaces is polymorphic, hence it is exposed throught this method.

      Returns:
      Schema tree namespace
    • findSchemaTreeStatement

      public static Optional<StmtContext<?,?,?>> findSchemaTreeStatement(StmtContext<?,?,?> root, org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier identifier)
      Find statement context identified by interpreting specified SchemaNodeIdentifier starting at specified StmtContext.
      Parameters:
      root - Search root context
      identifier - SchemaNodeIdentifier relative to search root
      Returns:
      Matching statement context, if present.
      Throws:
      NullPointerException - if any of the arguments is null