Interface SchemaSourceRepresentation

All Superinterfaces:
Identifiable<SourceIdentifier>, Immutable
All Known Subinterfaces:
YangSchemaSourceRepresentation, YinSchemaSourceRepresentation, YinXmlSchemaSource
All Known Implementing Classes:
YangIRSchemaSource, YangTextSchemaSource, YinDomSchemaSource, YinTextSchemaSource

@Beta public sealed interface SchemaSourceRepresentation extends Identifiable<SourceIdentifier>, Immutable permits YangSchemaSourceRepresentation, YinSchemaSourceRepresentation
Common interface for schema source representations. A schema source is an atomic piece of the overall schema context. In YANG terms, a schema source is semantically equivalent to a single YANG text file, be it a module or a submodule.

A schema source can exist in various forms, which we call representations. Again, in YANG terms, each representation is semantically equivalent, but from implementation perspective certain operations on a schema source may require it to be first transformed into a particular representation before they can be applied. Such transformations are affected via instances of SchemaSourceTransformation.

Typical examples of a schema source representation include:

  • a String - textual representation of source code
  • a InputStream - input stream containing source code
  • a ByteSource - source for input streams containing source code
  • Parsed abstract syntax tree (AST), which is the result of a syntactic parser

Implementations of this interface expected to comply with the Immutable contract.

  • Method Details

    • getIdentifier

      SourceIdentifier getIdentifier()
      Description copied from interface: Identifiable
      Return this objects Identifier.
      Specified by:
      getIdentifier in interface Identifiable<SourceIdentifier>
      Returns:
      Object's identifier, must not be null.
    • getType

      @NonNull Class<? extends SchemaSourceRepresentation> getType()
      Return the concrete representation type.
      Returns:
      The type of representation.
    • getSymbolicName

      Optional<String> getSymbolicName()
      Return the symbolic name, if available. This name has no semantic meaning beyond being useful for debugging by humans.
      Returns:
      Symbolic name, if available