Interface YangModuleInfo

All Superinterfaces:
Immutable
All Known Implementing Classes:
ResourceYangModuleInfo

@NonNullByDefault public interface YangModuleInfo extends Immutable
Information and model capture for Binding V1. Instances of this class identify a packaged model and allow access to its YANG text. They also contain references to YangModuleInfo instances as observed at code generation time.

The purpose of this class is to ensure package resolution order in OSGi environments, as implementations of this interface are required to be co-located with generated code. When this module relies on some imports, that dependency is expressed across jars via an implementation requirement to reference YangModuleInfos.

  • Method Details

    • getName

      QName getName()
      Returns YANG module name, as a composite QName. Module's namespace and revision maps to QName.getModule() and module name maps to AbstractQName.getLocalName().
      Returns:
      YANG module name.
    • openYangTextStream

      InputStream openYangTextStream() throws IOException
      Return an open stream containing YANG text for this module. The stream is required to be UTF-8 encoded.
      Returns:
      An open stream.
      Throws:
      IOException - If the stream cannot be opened.
    • getImportedModules

      default Collection<YangModuleInfo> getImportedModules()
      Return YangModuleInfo objects for all modules which are imported by this module. Default implementation returns an empty list.
      Returns:
      YangModuleInfo objects of all imported modules.
    • getYangTextByteSource

      default ByteSource getYangTextByteSource()
      Return a ByteSource accessing the YANG text of the module.
      Returns:
      A ByteSource.
    • getYangTextCharSource

      default CharSource getYangTextCharSource()
      Return a CharSource accessing the YANG text of the module.
      Returns:
      A CharSource.